[pypy-commit] pypy SpecialisedTuples: Update the demo.

arigo noreply at buildbot.pypy.org
Sun Dec 11 13:23:15 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: SpecialisedTuples
Changeset: r50376:f07d5e9e9d7a
Date: 2011-12-11 12:50 +0100
http://bitbucket.org/pypy/pypy/changeset/f07d5e9e9d7a/

Log:	Update the demo.

diff --git a/pypy/jit/tl/pypyjit_demo.py b/pypy/jit/tl/pypyjit_demo.py
--- a/pypy/jit/tl/pypyjit_demo.py
+++ b/pypy/jit/tl/pypyjit_demo.py
@@ -2,13 +2,15 @@
 pypyjit.set_param(threshold=200)
 
 
+def g(*args):
+    return len(args)
+
 def f(n):
-    pairs = [(0.0, 1.0), (2.0, 3.0)] * n
-    mag = 0
-    for (x1, x2) in pairs:
-        dx = x1 - x2
-        mag += ((dx * dx ) ** (-1.5))            
-    return n
+    s = 0
+    for i in range(n):
+        l = [i, n, 2]
+        s += g(*l)
+    return s
 
 try:
     print f(301)


More information about the pypy-commit mailing list