[pypy-svn] r23023 - pypy/dist/pypy/translator/microbench

pedronis at codespeak.net pedronis at codespeak.net
Sat Feb 4 13:40:21 CET 2006


Author: pedronis
Date: Sat Feb  4 13:40:17 2006
New Revision: 23023

Modified:
   pypy/dist/pypy/translator/microbench/test_count1.py
Log:
some other bechmarks for comparison



Modified: pypy/dist/pypy/translator/microbench/test_count1.py
==============================================================================
--- pypy/dist/pypy/translator/microbench/test_count1.py	(original)
+++ pypy/dist/pypy/translator/microbench/test_count1.py	Sat Feb  4 13:40:17 2006
@@ -7,6 +7,15 @@
         x = x + 1
 
 #
+def test_loop_other_count():
+    x = 0.0
+    n = N
+    c = 0
+    while c < n:
+        x = x + 1.0
+        c += 1
+
+#
 def test_count_in_slot():
     class X(object):
         __slots__ = 'x'
@@ -17,6 +26,15 @@
     while c < n:
         x.x = x.x + 1
         c += 1
+
+def test_count_in_dict():
+    d = {'a': 0, 'b': 0}
+    c = 0
+    d['x'] = 0
+    n = N
+    while c < n:
+        d['x'] = d['x'] + 1
+        c += 1
     
 #
 def plus1(x):



More information about the Pypy-commit mailing list