summaryrefslogtreecommitdiffstats
path: root/Tools/pybench/Dict.py
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2006-06-13 18:56:56 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2006-06-13 18:56:56 (GMT)
commit7d9743dd6aebe3da1118ed7f0abb7b9cdc6302ff (patch)
tree5fd8c25b53d192efbd69cbd42e6ae4016a215db0 /Tools/pybench/Dict.py
parentef7fe5f228292733965c87b99d50a21d64c6d196 (diff)
downloadcpython-7d9743dd6aebe3da1118ed7f0abb7b9cdc6302ff.zip
cpython-7d9743dd6aebe3da1118ed7f0abb7b9cdc6302ff.tar.gz
cpython-7d9743dd6aebe3da1118ed7f0abb7b9cdc6302ff.tar.bz2
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.
Diffstat (limited to 'Tools/pybench/Dict.py')
-rw-r--r--Tools/pybench/Dict.py78
1 files changed, 40 insertions, 38 deletions
diff --git a/Tools/pybench/Dict.py b/Tools/pybench/Dict.py
index 54aeae7..9cdd682 100644
--- a/Tools/pybench/Dict.py
+++ b/Tools/pybench/Dict.py
@@ -2,9 +2,9 @@ from pybench import Test
class DictCreation(Test):
- version = 0.3
+ version = 2.0
operations = 5*(5 + 5)
- rounds = 60000
+ rounds = 80000
def test(self):
@@ -77,7 +77,7 @@ class DictCreation(Test):
class DictWithStringKeys(Test):
- version = 0.1
+ version = 2.0
operations = 5*(6 + 6)
rounds = 200000
@@ -166,9 +166,9 @@ class DictWithStringKeys(Test):
class DictWithFloatKeys(Test):
- version = 0.1
+ version = 2.0
operations = 5*(6 + 6)
- rounds = 200000
+ rounds = 150000
def test(self):
@@ -255,7 +255,7 @@ class DictWithFloatKeys(Test):
class DictWithIntegerKeys(Test):
- version = 0.1
+ version = 2.0
operations = 5*(6 + 6)
rounds = 200000
@@ -344,13 +344,14 @@ class DictWithIntegerKeys(Test):
class SimpleDictManipulation(Test):
- version = 0.3
+ version = 2.0
operations = 5*(6 + 6 + 6 + 6)
- rounds = 50000
+ rounds = 100000
def test(self):
d = {}
+ has_key = d.has_key
for i in xrange(self.rounds):
@@ -368,12 +369,12 @@ class SimpleDictManipulation(Test):
x = d[4]
x = d[5]
- d.has_key(0)
- d.has_key(2)
- d.has_key(4)
- d.has_key(6)
- d.has_key(8)
- d.has_key(10)
+ has_key(0)
+ has_key(2)
+ has_key(4)
+ has_key(6)
+ has_key(8)
+ has_key(10)
del d[0]
del d[1]
@@ -396,12 +397,12 @@ class SimpleDictManipulation(Test):
x = d[4]
x = d[5]
- d.has_key(0)
- d.has_key(2)
- d.has_key(4)
- d.has_key(6)
- d.has_key(8)
- d.has_key(10)
+ has_key(0)
+ has_key(2)
+ has_key(4)
+ has_key(6)
+ has_key(8)
+ has_key(10)
del d[0]
del d[1]
@@ -424,12 +425,12 @@ class SimpleDictManipulation(Test):
x = d[4]
x = d[5]
- d.has_key(0)
- d.has_key(2)
- d.has_key(4)
- d.has_key(6)
- d.has_key(8)
- d.has_key(10)
+ has_key(0)
+ has_key(2)
+ has_key(4)
+ has_key(6)
+ has_key(8)
+ has_key(10)
del d[0]
del d[1]
@@ -452,12 +453,12 @@ class SimpleDictManipulation(Test):
x = d[4]
x = d[5]
- d.has_key(0)
- d.has_key(2)
- d.has_key(4)
- d.has_key(6)
- d.has_key(8)
- d.has_key(10)
+ has_key(0)
+ has_key(2)
+ has_key(4)
+ has_key(6)
+ has_key(8)
+ has_key(10)
del d[0]
del d[1]
@@ -480,12 +481,12 @@ class SimpleDictManipulation(Test):
x = d[4]
x = d[5]
- d.has_key(0)
- d.has_key(2)
- d.has_key(4)
- d.has_key(6)
- d.has_key(8)
- d.has_key(10)
+ has_key(0)
+ has_key(2)
+ has_key(4)
+ has_key(6)
+ has_key(8)
+ has_key(10)
del d[0]
del d[1]
@@ -497,6 +498,7 @@ class SimpleDictManipulation(Test):
def calibrate(self):
d = {}
+ has_key = d.has_key
for i in xrange(self.rounds):
pass