diff options
Diffstat (limited to 'Tools/pybench')
-rw-r--r-- | Tools/pybench/Arithmetic.py | 20 | ||||
-rw-r--r-- | Tools/pybench/Calls.py | 16 | ||||
-rw-r--r-- | Tools/pybench/Constructs.py | 12 | ||||
-rw-r--r-- | Tools/pybench/Dict.py | 20 | ||||
-rw-r--r-- | Tools/pybench/Exceptions.py | 8 | ||||
-rw-r--r-- | Tools/pybench/Imports.py | 12 | ||||
-rw-r--r-- | Tools/pybench/Instances.py | 4 | ||||
-rw-r--r-- | Tools/pybench/Lists.py | 12 | ||||
-rw-r--r-- | Tools/pybench/Lookups.py | 20 | ||||
-rw-r--r-- | Tools/pybench/NewInstances.py | 4 | ||||
-rw-r--r-- | Tools/pybench/Numbers.py | 16 | ||||
-rw-r--r-- | Tools/pybench/Strings.py | 28 | ||||
-rw-r--r-- | Tools/pybench/Tuples.py | 8 | ||||
-rw-r--r-- | Tools/pybench/Unicode.py | 28 | ||||
-rw-r--r-- | Tools/pybench/systimes.py | 2 |
15 files changed, 105 insertions, 105 deletions
diff --git a/Tools/pybench/Arithmetic.py b/Tools/pybench/Arithmetic.py index 6923b4b..6ef2f20 100644 --- a/Tools/pybench/Arithmetic.py +++ b/Tools/pybench/Arithmetic.py @@ -8,7 +8,7 @@ class SimpleIntegerArithmetic(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): a = 2 b = 3 @@ -152,7 +152,7 @@ class SimpleIntegerArithmetic(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass class SimpleFloatArithmetic(Test): @@ -163,7 +163,7 @@ class SimpleFloatArithmetic(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): a = 2.1 b = 3.3332 @@ -307,7 +307,7 @@ class SimpleFloatArithmetic(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass class SimpleIntFloatArithmetic(Test): @@ -318,7 +318,7 @@ class SimpleIntFloatArithmetic(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): a = 2 b = 3 @@ -462,7 +462,7 @@ class SimpleIntFloatArithmetic(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -474,7 +474,7 @@ class SimpleLongArithmetic(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): a = 2220001L b = 100001L @@ -618,7 +618,7 @@ class SimpleLongArithmetic(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass class SimpleComplexArithmetic(Test): @@ -629,7 +629,7 @@ class SimpleComplexArithmetic(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): a = 2 + 3j b = 2.5 + 4.5j @@ -773,5 +773,5 @@ class SimpleComplexArithmetic(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass diff --git a/Tools/pybench/Calls.py b/Tools/pybench/Calls.py index 72ccd0e..cfe0715 100644 --- a/Tools/pybench/Calls.py +++ b/Tools/pybench/Calls.py @@ -24,7 +24,7 @@ class PythonFunctionCalls(Test): return d,e,f # do calls - for i in xrange(self.rounds): + for i in range(self.rounds): f() f1(i) @@ -104,7 +104,7 @@ class PythonFunctionCalls(Test): return d,e,f # do calls - for i in xrange(self.rounds): + for i in range(self.rounds): pass ### @@ -124,7 +124,7 @@ class BuiltinFunctionCalls(Test): f3 = range # do calls - for i in xrange(self.rounds): + for i in range(self.rounds): f0() f0() @@ -225,7 +225,7 @@ class BuiltinFunctionCalls(Test): f3 = range # do calls - for i in xrange(self.rounds): + for i in range(self.rounds): pass ### @@ -261,7 +261,7 @@ class PythonMethodCalls(Test): o = c() - for i in xrange(self.rounds): + for i in range(self.rounds): o.f() o.f() @@ -367,7 +367,7 @@ class PythonMethodCalls(Test): o = c - for i in xrange(self.rounds): + for i in range(self.rounds): pass ### @@ -388,7 +388,7 @@ class Recursion(Test): return f(x-1) return 1 - for i in xrange(self.rounds): + for i in range(self.rounds): f(10) f(10) f(10) @@ -405,7 +405,7 @@ class Recursion(Test): return f(x-1) return 1 - for i in xrange(self.rounds): + for i in range(self.rounds): pass diff --git a/Tools/pybench/Constructs.py b/Tools/pybench/Constructs.py index 5105461..7273b87 100644 --- a/Tools/pybench/Constructs.py +++ b/Tools/pybench/Constructs.py @@ -9,7 +9,7 @@ class IfThenElse(Test): def test(self): a,b,c = 1,2,3 - for i in xrange(self.rounds): + for i in range(self.rounds): if a == 1: if b == 2: @@ -464,7 +464,7 @@ class IfThenElse(Test): def calibrate(self): a,b,c = 1,2,3 - for i in xrange(self.rounds): + for i in range(self.rounds): pass class NestedForLoops(Test): @@ -478,7 +478,7 @@ class NestedForLoops(Test): l1 = range(1000) l2 = range(10) l3 = range(5) - for i in xrange(self.rounds): + for i in range(self.rounds): for i in l1: for j in l2: for k in l3: @@ -489,7 +489,7 @@ class NestedForLoops(Test): l1 = range(1000) l2 = range(10) l3 = range(5) - for i in xrange(self.rounds): + for i in range(self.rounds): pass class ForLoops(Test): @@ -501,7 +501,7 @@ class ForLoops(Test): def test(self): l1 = range(100) - for i in xrange(self.rounds): + for i in range(self.rounds): for i in l1: pass for i in l1: @@ -560,5 +560,5 @@ class ForLoops(Test): def calibrate(self): l1 = range(1000) - for i in xrange(self.rounds): + for i in range(self.rounds): pass diff --git a/Tools/pybench/Dict.py b/Tools/pybench/Dict.py index cb039b0..575758b 100644 --- a/Tools/pybench/Dict.py +++ b/Tools/pybench/Dict.py @@ -8,7 +8,7 @@ class DictCreation(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): d1 = {} d2 = {} @@ -72,7 +72,7 @@ class DictCreation(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass class DictWithStringKeys(Test): @@ -85,7 +85,7 @@ class DictWithStringKeys(Test): d = {} - for i in xrange(self.rounds): + for i in range(self.rounds): d['abc'] = 1 d['def'] = 2 @@ -161,7 +161,7 @@ class DictWithStringKeys(Test): d = {} - for i in xrange(self.rounds): + for i in range(self.rounds): pass class DictWithFloatKeys(Test): @@ -174,7 +174,7 @@ class DictWithFloatKeys(Test): d = {} - for i in xrange(self.rounds): + for i in range(self.rounds): d[1.234] = 1 d[2.345] = 2 @@ -250,7 +250,7 @@ class DictWithFloatKeys(Test): d = {} - for i in xrange(self.rounds): + for i in range(self.rounds): pass class DictWithIntegerKeys(Test): @@ -263,7 +263,7 @@ class DictWithIntegerKeys(Test): d = {} - for i in xrange(self.rounds): + for i in range(self.rounds): d[1] = 1 d[2] = 2 @@ -339,7 +339,7 @@ class DictWithIntegerKeys(Test): d = {} - for i in xrange(self.rounds): + for i in range(self.rounds): pass class SimpleDictManipulation(Test): @@ -353,7 +353,7 @@ class SimpleDictManipulation(Test): d = {} has_key = lambda key: key in d - for i in xrange(self.rounds): + for i in range(self.rounds): d[0] = 3 d[1] = 4 @@ -500,5 +500,5 @@ class SimpleDictManipulation(Test): d = {} has_key = lambda key: key in d - for i in xrange(self.rounds): + for i in range(self.rounds): pass diff --git a/Tools/pybench/Exceptions.py b/Tools/pybench/Exceptions.py index ab0fa0a..c321b2e 100644 --- a/Tools/pybench/Exceptions.py +++ b/Tools/pybench/Exceptions.py @@ -10,7 +10,7 @@ class TryRaiseExcept(Test): error = ValueError - for i in xrange(self.rounds): + for i in range(self.rounds): try: raise error except: @@ -48,7 +48,7 @@ class TryRaiseExcept(Test): error = ValueError - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -60,7 +60,7 @@ class TryExcept(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): try: pass except: @@ -687,7 +687,7 @@ class TryExcept(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass ### Test to make Fredrik happy... diff --git a/Tools/pybench/Imports.py b/Tools/pybench/Imports.py index afc728b..399ba17 100644 --- a/Tools/pybench/Imports.py +++ b/Tools/pybench/Imports.py @@ -12,7 +12,7 @@ class SecondImport(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): import os import os import os @@ -45,7 +45,7 @@ class SecondImport(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -57,7 +57,7 @@ class SecondPackageImport(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): import package import package import package @@ -90,7 +90,7 @@ class SecondPackageImport(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass class SecondSubmoduleImport(Test): @@ -101,7 +101,7 @@ class SecondSubmoduleImport(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): import package.submodule import package.submodule import package.submodule @@ -134,5 +134,5 @@ class SecondSubmoduleImport(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass diff --git a/Tools/pybench/Instances.py b/Tools/pybench/Instances.py index 1dfc82f..0a09b7b 100644 --- a/Tools/pybench/Instances.py +++ b/Tools/pybench/Instances.py @@ -26,7 +26,7 @@ class CreateInstances(Test): self.e = b self.f = c - for i in xrange(self.rounds): + for i in range(self.rounds): o = c() o1 = c() o2 = c() @@ -62,5 +62,5 @@ class CreateInstances(Test): self.e = b self.f = c - for i in xrange(self.rounds): + for i in range(self.rounds): pass diff --git a/Tools/pybench/Lists.py b/Tools/pybench/Lists.py index 67760db..aedd352 100644 --- a/Tools/pybench/Lists.py +++ b/Tools/pybench/Lists.py @@ -11,7 +11,7 @@ class SimpleListManipulation(Test): l = [] append = l.append - for i in xrange(self.rounds): + for i in range(self.rounds): append(2) append(3) @@ -127,7 +127,7 @@ class SimpleListManipulation(Test): l = [] append = l.append - for i in xrange(self.rounds): + for i in range(self.rounds): pass class ListSlicing(Test): @@ -141,7 +141,7 @@ class ListSlicing(Test): n = range(100) r = range(25) - for i in xrange(self.rounds): + for i in range(self.rounds): l = n[:] @@ -160,7 +160,7 @@ class ListSlicing(Test): n = range(100) r = range(25) - for i in xrange(self.rounds): + for i in range(self.rounds): for j in r: pass @@ -172,7 +172,7 @@ class SmallLists(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): l = [] @@ -291,5 +291,5 @@ class SmallLists(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass diff --git a/Tools/pybench/Lookups.py b/Tools/pybench/Lookups.py index e454a00..5bf9e76 100644 --- a/Tools/pybench/Lookups.py +++ b/Tools/pybench/Lookups.py @@ -11,7 +11,7 @@ class SpecialClassAttribute(Test): class c: pass - for i in xrange(self.rounds): + for i in range(self.rounds): c.__a = 2 c.__b = 3 @@ -178,7 +178,7 @@ class SpecialClassAttribute(Test): class c: pass - for i in xrange(self.rounds): + for i in range(self.rounds): pass class NormalClassAttribute(Test): @@ -192,7 +192,7 @@ class NormalClassAttribute(Test): class c: pass - for i in xrange(self.rounds): + for i in range(self.rounds): c.a = 2 c.b = 3 @@ -364,7 +364,7 @@ class NormalClassAttribute(Test): class c: pass - for i in xrange(self.rounds): + for i in range(self.rounds): pass class SpecialInstanceAttribute(Test): @@ -379,7 +379,7 @@ class SpecialInstanceAttribute(Test): pass o = c() - for i in xrange(self.rounds): + for i in range(self.rounds): o.__a__ = 2 o.__b__ = 3 @@ -552,7 +552,7 @@ class SpecialInstanceAttribute(Test): pass o = c() - for i in xrange(self.rounds): + for i in range(self.rounds): pass class NormalInstanceAttribute(Test): @@ -567,7 +567,7 @@ class NormalInstanceAttribute(Test): pass o = c() - for i in xrange(self.rounds): + for i in range(self.rounds): o.a = 2 o.b = 3 @@ -740,7 +740,7 @@ class NormalInstanceAttribute(Test): pass o = c() - for i in xrange(self.rounds): + for i in range(self.rounds): pass class BuiltinMethodLookup(Test): @@ -754,7 +754,7 @@ class BuiltinMethodLookup(Test): l = [] d = {} - for i in xrange(self.rounds): + for i in range(self.rounds): l.append l.append @@ -941,5 +941,5 @@ class BuiltinMethodLookup(Test): l = [] d = {} - for i in xrange(self.rounds): + for i in range(self.rounds): pass diff --git a/Tools/pybench/NewInstances.py b/Tools/pybench/NewInstances.py index 258beba..9506da4 100644 --- a/Tools/pybench/NewInstances.py +++ b/Tools/pybench/NewInstances.py @@ -35,7 +35,7 @@ class CreateNewInstances(Test): self.e = b self.f = c - for i in xrange(self.rounds): + for i in range(self.rounds): o = c() o1 = c() o2 = c() @@ -71,5 +71,5 @@ class CreateNewInstances(Test): self.e = b self.f = c - for i in xrange(self.rounds): + for i in range(self.rounds): pass diff --git a/Tools/pybench/Numbers.py b/Tools/pybench/Numbers.py index 10c8940..b0a11f4 100644 --- a/Tools/pybench/Numbers.py +++ b/Tools/pybench/Numbers.py @@ -8,7 +8,7 @@ class CompareIntegers(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): 2 < 3 2 > 3 @@ -192,7 +192,7 @@ class CompareIntegers(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -204,7 +204,7 @@ class CompareFloats(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): 2.1 < 3.31 2.1 > 3.31 @@ -388,7 +388,7 @@ class CompareFloats(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -400,7 +400,7 @@ class CompareFloatsIntegers(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): 2.1 < 4 2.1 > 4 @@ -584,7 +584,7 @@ class CompareFloatsIntegers(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -596,7 +596,7 @@ class CompareLongs(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): 1234567890L < 3456789012345L 1234567890L > 3456789012345L @@ -780,5 +780,5 @@ class CompareLongs(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass diff --git a/Tools/pybench/Strings.py b/Tools/pybench/Strings.py index dc49df1..2668d6b 100644 --- a/Tools/pybench/Strings.py +++ b/Tools/pybench/Strings.py @@ -14,7 +14,7 @@ class ConcatStrings(Test): s = join(map(str,range(100))) t = join(map(str,range(1,101))) - for i in xrange(self.rounds): + for i in range(self.rounds): t + s t + s t + s @@ -80,7 +80,7 @@ class ConcatStrings(Test): s = join(map(str,range(100))) t = join(map(str,range(1,101))) - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -96,7 +96,7 @@ class CompareStrings(Test): s = join(map(str,range(10))) t = join(map(str,range(10))) + "abc" - for i in xrange(self.rounds): + for i in range(self.rounds): t < s t > s t == s @@ -162,7 +162,7 @@ class CompareStrings(Test): s = join(map(str,range(10))) t = join(map(str,range(10))) + "abc" - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -178,7 +178,7 @@ class CompareInternedStrings(Test): s = sys.intern(join(map(str,range(10)))) t = s - for i in xrange(self.rounds): + for i in range(self.rounds): t == s t == s t >= s @@ -244,7 +244,7 @@ class CompareInternedStrings(Test): s = sys.intern(join(map(str,range(10)))) t = s - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -256,7 +256,7 @@ class CreateStringsWithConcat(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): s = 'om' s = s + 'xbx' s = s + 'xcx' @@ -319,7 +319,7 @@ class CreateStringsWithConcat(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -333,7 +333,7 @@ class StringSlicing(Test): s = join(map(str,range(100))) - for i in xrange(self.rounds): + for i in range(self.rounds): s[50:] s[:25] @@ -379,7 +379,7 @@ class StringSlicing(Test): s = join(map(str,range(100))) - for i in xrange(self.rounds): + for i in range(self.rounds): pass ### String methods @@ -399,7 +399,7 @@ if hasattr('', 'lower'): u = join(map(chr,range(100)),'') v = join(map(chr,range(256)),'') - for i in xrange(self.rounds): + for i in range(self.rounds): s.lower() s.lower() @@ -456,7 +456,7 @@ if hasattr('', 'lower'): u = join(map(chr,range(100)),'') v = join(map(chr,range(256)),'') - for i in xrange(self.rounds): + for i in range(self.rounds): pass class StringPredicates(Test): @@ -470,7 +470,7 @@ if hasattr('', 'lower'): data = ('abc', '123', ' ', '\xe4\xf6\xfc', '\xdf'*10) len_data = len(data) - for i in xrange(self.rounds): + for i in range(self.rounds): s = data[i % len_data] s.isalnum() @@ -559,5 +559,5 @@ if hasattr('', 'lower'): data = ('abc', '123', ' ', '\xe4\xf6\xfc', '\xdf'*10) len_data = len(data) - for i in xrange(self.rounds): + for i in range(self.rounds): s = data[i % len_data] diff --git a/Tools/pybench/Tuples.py b/Tools/pybench/Tuples.py index 8e46989..d93802c 100644 --- a/Tools/pybench/Tuples.py +++ b/Tools/pybench/Tuples.py @@ -11,7 +11,7 @@ class TupleSlicing(Test): r = range(25) t = tuple(range(100)) - for i in xrange(self.rounds): + for i in range(self.rounds): for j in r: @@ -260,7 +260,7 @@ class TupleSlicing(Test): r = range(25) t = tuple(range(100)) - for i in xrange(self.rounds): + for i in range(self.rounds): for j in r: pass @@ -272,7 +272,7 @@ class SmallTuples(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): t = (1,2,3,4,5,6) @@ -356,5 +356,5 @@ class SmallTuples(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass diff --git a/Tools/pybench/Unicode.py b/Tools/pybench/Unicode.py index 153a91e..21e24c0 100644 --- a/Tools/pybench/Unicode.py +++ b/Tools/pybench/Unicode.py @@ -18,7 +18,7 @@ class ConcatUnicode(Test): s = unicode(join(map(str,range(100)))) t = unicode(join(map(str,range(1,101)))) - for i in xrange(self.rounds): + for i in range(self.rounds): t + s t + s t + s @@ -84,7 +84,7 @@ class ConcatUnicode(Test): s = unicode(join(map(str,range(100)))) t = unicode(join(map(str,range(1,101)))) - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -100,7 +100,7 @@ class CompareUnicode(Test): s = unicode(join(map(str,range(10)))) t = unicode(join(map(str,range(10))) + "abc") - for i in xrange(self.rounds): + for i in range(self.rounds): t < s t > s t == s @@ -166,7 +166,7 @@ class CompareUnicode(Test): s = unicode(join(map(str,range(10)))) t = unicode(join(map(str,range(10))) + "abc") - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -178,7 +178,7 @@ class CreateUnicodeWithConcat(Test): def test(self): - for i in xrange(self.rounds): + for i in range(self.rounds): s = u'om' s = s + u'xbx' s = s + u'xcx' @@ -241,7 +241,7 @@ class CreateUnicodeWithConcat(Test): def calibrate(self): - for i in xrange(self.rounds): + for i in range(self.rounds): pass @@ -255,7 +255,7 @@ class UnicodeSlicing(Test): s = unicode(join(map(str,range(100)))) - for i in xrange(self.rounds): + for i in range(self.rounds): s[50:] s[:25] @@ -301,7 +301,7 @@ class UnicodeSlicing(Test): s = unicode(join(map(str,range(100)))) - for i in xrange(self.rounds): + for i in range(self.rounds): pass ### String methods @@ -319,7 +319,7 @@ class UnicodeMappings(Test): u = join(map(unichr,range(500)),'') v = join(map(unichr,range(1000)),'') - for i in xrange(self.rounds): + for i in range(self.rounds): s.lower() s.lower() @@ -376,7 +376,7 @@ class UnicodeMappings(Test): u = join(map(unichr,range(500)),'') v = join(map(unichr,range(1000)),'') - for i in xrange(self.rounds): + for i in range(self.rounds): pass class UnicodePredicates(Test): @@ -390,7 +390,7 @@ class UnicodePredicates(Test): data = (u'abc', u'123', u' ', u'\u1234\u2345\u3456', u'\uFFFF'*10) len_data = len(data) - for i in xrange(self.rounds): + for i in range(self.rounds): s = data[i % len_data] s.isalnum() @@ -448,7 +448,7 @@ class UnicodePredicates(Test): data = (u'abc', u'123', u' ', u'\u1234\u2345\u3456', u'\uFFFF'*10) len_data = len(data) - for i in xrange(self.rounds): + for i in range(self.rounds): s = data[i % len_data] try: @@ -475,7 +475,7 @@ else: mirrored = unicodedata.mirrored combining = unicodedata.combining - for i in xrange(self.rounds): + for i in range(self.rounds): c = data[i % len_data] @@ -537,6 +537,6 @@ else: mirrored = unicodedata.mirrored combining = unicodedata.combining - for i in xrange(self.rounds): + for i in range(self.rounds): c = data[i % len_data] diff --git a/Tools/pybench/systimes.py b/Tools/pybench/systimes.py index bf07e36..5478c28 100644 --- a/Tools/pybench/systimes.py +++ b/Tools/pybench/systimes.py @@ -181,7 +181,7 @@ def processtime(): def some_workload(): x = 0L - for i in xrange(10000000L): + for i in range(10000000L): x = x + 1L def test_workload(): |