Index: Tools/pybench/pybench.py =================================================================== --- Tools/pybench/pybench.py (révision 69156) +++ Tools/pybench/pybench.py (copie de travail) @@ -44,7 +44,7 @@ import pickle # Version number; version history: see README file ! -__version__ = '2.0' +__version__ = '3.0' ### Constants @@ -174,7 +174,7 @@ # Version number of the test as float (x.yy); this is important # for comparisons of benchmark runs - tests with unequal version # number will not get compared. - version = 2.0 + version = 3.0 # The number of abstract operations done in each round of the # test. An operation is the basic unit of what you want to @@ -403,7 +403,7 @@ roundtime = 0 # Benchmark version number as float x.yy - version = 2.0 + version = 3.0 # Produce verbose output ? verbose = 0 Index: Tools/pybench/Strings.py =================================================================== --- Tools/pybench/Strings.py (révision 69156) +++ Tools/pybench/Strings.py (copie de travail) @@ -3,7 +3,7 @@ class ConcatStrings(Test): - version = 2.0 + version = 3.0 operations = 10 * 5 rounds = 100000 @@ -85,7 +85,7 @@ class CompareStrings(Test): - version = 2.0 + version = 3.0 operations = 10 * 5 rounds = 200000 @@ -167,7 +167,7 @@ class CompareInternedStrings(Test): - version = 2.0 + version = 3.0 operations = 10 * 5 rounds = 300000 @@ -249,7 +249,7 @@ class CreateStringsWithConcat(Test): - version = 2.0 + version = 3.0 operations = 10 * 5 rounds = 200000 @@ -324,7 +324,7 @@ class StringSlicing(Test): - version = 2.0 + version = 3.0 operations = 5 * 7 rounds = 160000 @@ -387,7 +387,7 @@ class StringMappings(Test): - version = 2.0 + version = 3.0 operations = 3 * (5 + 4 + 2 + 1) rounds = 70000 @@ -460,7 +460,7 @@ class StringPredicates(Test): - version = 2.0 + version = 3.0 operations = 10 * 7 rounds = 100000 Index: Tools/pybench/Arithmetic.py =================================================================== --- Tools/pybench/Arithmetic.py (révision 69156) +++ Tools/pybench/Arithmetic.py (copie de travail) @@ -2,7 +2,7 @@ class SimpleIntegerArithmetic(Test): - version = 2.0 + version = 3.0 operations = 5 * (3 + 5 + 5 + 3 + 3 + 3) rounds = 120000 @@ -157,7 +157,7 @@ class SimpleFloatArithmetic(Test): - version = 2.0 + version = 3.0 operations = 5 * (3 + 5 + 5 + 3 + 3 + 3) rounds = 120000 @@ -312,7 +312,7 @@ class SimpleIntFloatArithmetic(Test): - version = 2.0 + version = 3.0 operations = 5 * (3 + 5 + 5 + 3 + 3 + 3) rounds = 120000 @@ -468,7 +468,7 @@ class SimpleLongArithmetic(Test): - version = 2.0 + version = 3.0 operations = 5 * (3 + 5 + 5 + 3 + 3 + 3) rounds = 60000 @@ -623,7 +623,7 @@ class SimpleComplexArithmetic(Test): - version = 2.0 + version = 3.0 operations = 5 * (3 + 5 + 5 + 3 + 3 + 3) rounds = 80000 Index: Tools/pybench/Lookups.py =================================================================== --- Tools/pybench/Lookups.py (révision 69156) +++ Tools/pybench/Lookups.py (copie de travail) @@ -2,7 +2,7 @@ class SpecialClassAttribute(Test): - version = 2.0 + version = 3.0 operations = 5*(12 + 12) rounds = 100000 @@ -183,7 +183,7 @@ class NormalClassAttribute(Test): - version = 2.0 + version = 3.0 operations = 5*(12 + 12) rounds = 100000 @@ -369,7 +369,7 @@ class SpecialInstanceAttribute(Test): - version = 2.0 + version = 3.0 operations = 5*(12 + 12) rounds = 100000 @@ -557,7 +557,7 @@ class NormalInstanceAttribute(Test): - version = 2.0 + version = 3.0 operations = 5*(12 + 12) rounds = 100000 @@ -745,7 +745,7 @@ class BuiltinMethodLookup(Test): - version = 2.0 + version = 3.0 operations = 5*(3*5 + 3*5) rounds = 70000 Index: Tools/pybench/Imports.py =================================================================== --- Tools/pybench/Imports.py (révision 69156) +++ Tools/pybench/Imports.py (copie de travail) @@ -6,7 +6,7 @@ class SecondImport(Test): - version = 2.0 + version = 3.0 operations = 5 * 5 rounds = 40000 @@ -51,7 +51,7 @@ class SecondPackageImport(Test): - version = 2.0 + version = 3.0 operations = 5 * 5 rounds = 40000 @@ -95,7 +95,7 @@ class SecondSubmoduleImport(Test): - version = 2.0 + version = 3.0 operations = 5 * 5 rounds = 40000 Index: Tools/pybench/Lists.py =================================================================== --- Tools/pybench/Lists.py (révision 69156) +++ Tools/pybench/Lists.py (copie de travail) @@ -2,7 +2,7 @@ class SimpleListManipulation(Test): - version = 2.0 + version = 3.0 operations = 5* (6 + 6 + 6) rounds = 130000 @@ -132,7 +132,7 @@ class ListSlicing(Test): - version = 2.0 + version = 3.0 operations = 25*(3+1+2+1) rounds = 800 @@ -166,7 +166,7 @@ class SmallLists(Test): - version = 2.0 + version = 3.0 operations = 5*(1+ 6 + 6 + 3 + 1) rounds = 80000 Index: Tools/pybench/Calls.py =================================================================== --- Tools/pybench/Calls.py (révision 69156) +++ Tools/pybench/Calls.py (copie de travail) @@ -2,7 +2,7 @@ class PythonFunctionCalls(Test): - version = 2.0 + version = 3.0 operations = 5*(1+4+4+2) rounds = 60000 @@ -111,7 +111,7 @@ class ComplexPythonFunctionCalls(Test): - version = 2.0 + version = 3.0 operations = 4*5 rounds = 100000 @@ -169,7 +169,7 @@ class BuiltinFunctionCalls(Test): - version = 2.0 + version = 3.0 operations = 5*(2+5+5+5) rounds = 60000 @@ -178,8 +178,8 @@ # localize functions f0 = globals f1 = hash - f2 = cmp - f3 = range + f2 = divmod + f3 = max # do calls for i in range(self.rounds): @@ -279,8 +279,8 @@ # localize functions f0 = dir f1 = hash - f2 = range - f3 = range + f2 = divmod + f3 = max # do calls for i in range(self.rounds): @@ -290,7 +290,7 @@ class PythonMethodCalls(Test): - version = 2.0 + version = 3.0 operations = 5*(6 + 5 + 4) rounds = 30000 @@ -432,7 +432,7 @@ class Recursion(Test): - version = 2.0 + version = 3.0 operations = 5 rounds = 100000 Index: Tools/pybench/NewInstances.py =================================================================== --- Tools/pybench/NewInstances.py (révision 69156) +++ Tools/pybench/NewInstances.py (copie de travail) @@ -11,7 +11,7 @@ class CreateNewInstances(Test): - version = 2.0 + version = 3.0 operations = 3 + 7 + 4 rounds = 60000 Index: Tools/pybench/README =================================================================== --- Tools/pybench/README (révision 69156) +++ Tools/pybench/README (copie de travail) @@ -82,7 +82,7 @@ --examples show examples of usage Version: - 2.0 + 3.0 The normal operation is to run the suite and display the results. Use -f to save them for later reuse or comparisons. @@ -331,6 +331,12 @@ Version History --------------- + 3.0: made some minor changes for compatibility with Python 3.0: + - replaced cmp with complex and range with pow in Calls.py + (cmp no longer exists in 3.0, and range is a list in + Python 2.x and an iterator in Python 3.x) + - bumped all test versions to 3.0 + 2.0: rewrote parts of pybench which resulted in more repeatable timings: - made timer a parameter Index: Tools/pybench/Constructs.py =================================================================== --- Tools/pybench/Constructs.py (révision 69156) +++ Tools/pybench/Constructs.py (copie de travail) @@ -2,7 +2,7 @@ class IfThenElse(Test): - version = 2.0 + version = 3.0 operations = 30*3 # hard to say... rounds = 150000 @@ -469,7 +469,7 @@ class NestedForLoops(Test): - version = 2.0 + version = 3.0 operations = 1000*10*5 rounds = 300 @@ -494,7 +494,7 @@ class ForLoops(Test): - version = 2.0 + version = 3.0 operations = 5 * 5 rounds = 10000 Index: Tools/pybench/Numbers.py =================================================================== --- Tools/pybench/Numbers.py (révision 69156) +++ Tools/pybench/Numbers.py (copie de travail) @@ -2,7 +2,7 @@ class CompareIntegers(Test): - version = 2.0 + version = 3.0 operations = 30 * 5 rounds = 120000 @@ -198,7 +198,7 @@ class CompareFloats(Test): - version = 2.0 + version = 3.0 operations = 30 * 5 rounds = 80000 @@ -394,7 +394,7 @@ class CompareFloatsIntegers(Test): - version = 2.0 + version = 3.0 operations = 30 * 5 rounds = 60000 @@ -590,7 +590,7 @@ class CompareLongs(Test): - version = 2.0 + version = 3.0 operations = 30 * 5 rounds = 70000 Index: Tools/pybench/With.py =================================================================== --- Tools/pybench/With.py (révision 69156) +++ Tools/pybench/With.py (copie de travail) @@ -3,7 +3,7 @@ class WithFinally(Test): - version = 2.0 + version = 3.0 operations = 20 rounds = 80000 @@ -49,7 +49,7 @@ class TryFinally(Test): - version = 2.0 + version = 3.0 operations = 20 rounds = 80000 @@ -156,7 +156,7 @@ class WithRaiseExcept(Test): - version = 2.0 + version = 3.0 operations = 2 + 3 + 3 rounds = 100000 Index: Tools/pybench/Tuples.py =================================================================== --- Tools/pybench/Tuples.py (révision 69156) +++ Tools/pybench/Tuples.py (copie de travail) @@ -2,7 +2,7 @@ class TupleSlicing(Test): - version = 2.0 + version = 3.0 operations = 3 * 25 * 10 * 7 rounds = 500 @@ -266,7 +266,7 @@ class SmallTuples(Test): - version = 2.0 + version = 3.0 operations = 5*(1 + 3 + 6 + 2) rounds = 90000 Index: Tools/pybench/Exceptions.py =================================================================== --- Tools/pybench/Exceptions.py (révision 69156) +++ Tools/pybench/Exceptions.py (copie de travail) @@ -2,7 +2,7 @@ class TryRaiseExcept(Test): - version = 2.0 + version = 3.0 operations = 2 + 3 + 3 rounds = 80000 @@ -54,7 +54,7 @@ class TryExcept(Test): - version = 2.0 + version = 3.0 operations = 15 * 10 rounds = 150000 Index: Tools/pybench/Dict.py =================================================================== --- Tools/pybench/Dict.py (révision 69156) +++ Tools/pybench/Dict.py (copie de travail) @@ -2,7 +2,7 @@ class DictCreation(Test): - version = 2.0 + version = 3.0 operations = 5*(5 + 5) rounds = 80000 @@ -77,7 +77,7 @@ class DictWithStringKeys(Test): - version = 2.0 + version = 3.0 operations = 5*(6 + 6) rounds = 200000 @@ -166,7 +166,7 @@ class DictWithFloatKeys(Test): - version = 2.0 + version = 3.0 operations = 5*(6 + 6) rounds = 150000 @@ -255,7 +255,7 @@ class DictWithIntegerKeys(Test): - version = 2.0 + version = 3.0 operations = 5*(6 + 6) rounds = 200000 @@ -344,7 +344,7 @@ class SimpleDictManipulation(Test): - version = 2.0 + version = 3.0 operations = 5*(6 + 6 + 6 + 6) rounds = 100000 Index: Tools/pybench/Unicode.py =================================================================== --- Tools/pybench/Unicode.py (révision 69156) +++ Tools/pybench/Unicode.py (copie de travail) @@ -7,7 +7,7 @@ class ConcatUnicode(Test): - version = 2.0 + version = 3.0 operations = 10 * 5 rounds = 60000 @@ -89,7 +89,7 @@ class CompareUnicode(Test): - version = 2.0 + version = 3.0 operations = 10 * 5 rounds = 150000 @@ -171,7 +171,7 @@ class CreateUnicodeWithConcat(Test): - version = 2.0 + version = 3.0 operations = 10 * 5 rounds = 80000 @@ -246,7 +246,7 @@ class UnicodeSlicing(Test): - version = 2.0 + version = 3.0 operations = 5 * 7 rounds = 140000 @@ -307,7 +307,7 @@ class UnicodeMappings(Test): - version = 2.0 + version = 3.0 operations = 3 * (5 + 4 + 2 + 1) rounds = 10000 @@ -380,7 +380,7 @@ class UnicodePredicates(Test): - version = 2.0 + version = 3.0 operations = 5 * 9 rounds = 120000 @@ -457,7 +457,7 @@ else: class UnicodeProperties(Test): - version = 2.0 + version = 3.0 operations = 5 * 8 rounds = 100000 Index: Tools/pybench/Instances.py =================================================================== --- Tools/pybench/Instances.py (révision 69156) +++ Tools/pybench/Instances.py (copie de travail) @@ -2,7 +2,7 @@ class CreateInstances(Test): - version = 2.0 + version = 3.0 operations = 3 + 7 + 4 rounds = 80000