[pypy-svn] r58672 - pypy/build/benchmem/benchmark

fijal at codespeak.net fijal at codespeak.net
Mon Oct 6 17:47:51 CEST 2008


Author: fijal
Date: Mon Oct  6 17:47:51 2008
New Revision: 58672

Added:
   pypy/build/benchmem/benchmark/appprofiles.py   (contents, props changed)
Log:
Start with app profiles


Added: pypy/build/benchmem/benchmark/appprofiles.py
==============================================================================
--- (empty file)
+++ pypy/build/benchmem/benchmark/appprofiles.py	Mon Oct  6 17:47:51 2008
@@ -0,0 +1,25 @@
+
+class newstyle(object):
+    def __init__(self, i, next):
+        self.i = 100 + i
+        self.next = next
+
+class oldstyle(object):
+    def __init__(self, f, next):
+        self.f = float(f)
+        self.next = next
+
+def bench_allocate_and_throw_away(iter1, iter2):
+    for i in range(iter1):
+        next = None
+        for j in range(iter2):
+            r = j % 4
+            if r == 0:
+                next = newstyle(j, next)
+            elif r == 1:
+                next = oldstyle(j, next)
+            elif r == 2:
+                next = (j + 3, next)
+            elif r == 3:
+                next = [float(j), next]
+



More information about the Pypy-commit mailing list