Updated to pybench 2.0.

See svn.python.org/external/pybench-2.0 for the original import of that
version.

Note that platform.py was not copied over from pybench-2.0 since
it is already part of Python 2.5.
This commit is contained in:
Marc-André Lemburg 2006-06-13 18:56:56 +00:00
parent ef7fe5f228
commit 7d9743dd6a
20 changed files with 1240 additions and 649 deletions

View file

@ -2,9 +2,9 @@ from pybench import Test
class TryRaiseExcept(Test):
version = 0.1
operations = 2 + 3
rounds = 60000
version = 2.0
operations = 2 + 3 + 3
rounds = 80000
def test(self):
@ -31,6 +31,18 @@ class TryRaiseExcept(Test):
raise error,"something"
except:
pass
try:
raise error("something")
except:
pass
try:
raise error("something")
except:
pass
try:
raise error("something")
except:
pass
def calibrate(self):
@ -42,9 +54,9 @@ class TryRaiseExcept(Test):
class TryExcept(Test):
version = 0.1
version = 2.0
operations = 15 * 10
rounds = 200000
rounds = 150000
def test(self):
@ -677,3 +689,11 @@ class TryExcept(Test):
for i in xrange(self.rounds):
pass
### Test to make Fredrik happy...
if __name__ == '__main__':
import timeit
timeit.TestClass = TryRaiseExcept
timeit.main(['-s', 'test = TestClass(); test.rounds = 1000',
'test.test()'])