Calculation of the number of pystones equivalent to one second is inaccurate
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zope.testbrowser |
Invalid
|
Undecided
|
Unassigned |
Bug Description
The current implementation is highly inaccurate because the number of loops is not high enough, for example:
>>> for i in range(30):
... print pystone.
...
83333.3333333
100000.0
100000.0
125000.0
100000.0
100000.0
100000.0
100000.0
125000.0
100000.0
100000.0
100000.0
100000.0
125000.0
100000.0
100000.0
100000.0
100000.0
100000.0
100000.0
125000.0
100000.0
125000.0
100000.0
100000.0
125000.0
125000.0
125000.0
125000.0
125000.0
However, when using the defaults number of loops, the value is much more accurate:
>>> for i in range(30):
... print pystone.
...
102040.816327
104166.666667
102040.816327
100000.0
100000.0
100000.0
102040.816327
100000.0
96153.8461538
94339.6226415
98039.2156863
100000.0
98039.2156863
94339.6226415
102040.816327
100000.0
100000.0
102040.816327
102040.816327
100000.0
100000.0
100000.0
100000.0
100000.0
98039.2156863
100000.0
100000.0
102040.816327
102040.816327
106382.978723
As the pystones per second value is only computed once, I think that it should not be a problem to use the default number of loops (namely 50000). Therefore, could you please apply the attached patch? Thanks.
The zope.testbrowser project on Launchpad has been archived at the request of the Zope developers (see https:/ /answers. launchpad. net/launchpad/ +question/ 683589 and https:/ /answers. launchpad. net/launchpad/ +question/ 685285). If this bug is still relevant, please refile it at https:/ /github. com/zopefoundat ion/zope. testbrowser.