[pypy-commit] pypy improve-rbigint: A little sad news, lshift with tiny numbers are nearly twice as slow using int128.

stian noreply at buildbot.pypy.org
Sat Jul 21 18:41:27 CEST 2012


Author: stian
Branch: improve-rbigint
Changeset: r56339:5f2143a12b5c
Date: 2012-06-26 07:21 +0200
http://bitbucket.org/pypy/pypy/changeset/5f2143a12b5c/

Log:	A little sad news, lshift with tiny numbers are nearly twice as slow
	using int128.

	It's not a slow operation tho, 2.875e-08 per round. For comparesment
	2**n (![0->10000]) takes 9.66e-04 per round (and thats 50 times
	faster than unmodified pypy). Even a regular add operation takes
	1e-05 per round.

diff --git a/pypy/rlib/rbigint.py b/pypy/rlib/rbigint.py
--- a/pypy/rlib/rbigint.py
+++ b/pypy/rlib/rbigint.py
@@ -690,10 +690,9 @@
             accum >>= SHIFT
             i += 1
             j += 1
-        if remshift:
-            z.setdigit(newsize - 1, accum)
-        else:
-            assert not accum
+            
+        z.setdigit(newsize - 1, accum)
+
         z._normalize()
         return z
 
diff --git a/pypy/translator/goal/targetbigintbenchmark.py b/pypy/translator/goal/targetbigintbenchmark.py
--- a/pypy/translator/goal/targetbigintbenchmark.py
+++ b/pypy/translator/goal/targetbigintbenchmark.py
@@ -8,8 +8,12 @@
 
 def entry_point(argv):
     """
+        All benchmarks are run using --opt=2 and minimark gc (default).
+        
         A cutout with some benchmarks.
         Pypy default:
+        2.316023
+        2.418211
         5.147583
         5.139127
         484.5688


More information about the pypy-commit mailing list