[pypy-commit] pypy improve-rbigint: Revert changes to _x_add and _x_sub, it didn't provide speedup. And potensially it'll bug. Also updated benchmark results
stian
noreply at buildbot.pypy.org
Sat Jul 21 18:41:34 CEST 2012
Author: stian
Branch: improve-rbigint
Changeset: r56345:dc6ff563855d
Date: 2012-07-04 02:32 +0200
http://bitbucket.org/pypy/pypy/changeset/dc6ff563855d/
Log: Revert changes to _x_add and _x_sub, it didn't provide speedup. And
potensially it'll bug. Also updated benchmark results
diff --git a/pypy/rlib/rbigint.py b/pypy/rlib/rbigint.py
--- a/pypy/rlib/rbigint.py
+++ b/pypy/rlib/rbigint.py
@@ -944,15 +944,12 @@
z.setdigit(i, carry)
carry >>= SHIFT
i += 1
- if i < size_a:
+ while i < size_a:
carry += a.udigit(i)
z.setdigit(i, carry)
+ carry >>= SHIFT
i += 1
- while i < size_a:
- z.setdigit(i, a.udigit(i))
- i += 1
- else:
- z.setdigit(i, carry)
+ z.setdigit(i, carry)
z._normalize()
return z
@@ -995,15 +992,13 @@
borrow >>= SHIFT
borrow &= 1 # Keep only one sign bit
i += 1
- if i < size_a:
+ while i < size_a:
borrow = a.udigit(i) - borrow
z.setdigit(i, borrow)
+ borrow >>= SHIFT
+ borrow &= 1
i += 1
- assert borrow >> 63 == 0
-
- while i < size_a:
- z.setdigit(i, a.udigit(i))
- i += 1
+ assert borrow == 0
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
@@ -47,20 +47,20 @@
A pure python form of those tests where also run
Improved pypy | Pypy | CPython 2.7.3
- 0.0440728664398 2.82172012329 1.38699007034
- 0.1241710186 0.126130104065 8.17586708069
- 0.12434387207 0.124358177185 8.34655714035
- 0.0627701282501 0.0626962184906 4.88309693336
- 0.0636250972748 0.0626759529114 4.88519001007
- 1.20847392082 479.282402992 (forever, I yet it run for 5min before quiting)
- 1.66941714287 (forever) (another forever)
- 0.0701060295105 6.59566307068 8.29050803185
- 6.55810189247 12.1487128735 7.1309800148
- 7.59417295456 15.0498359203 11.733394146
- 0.00144410133362 2.13657021523 1.67227101326
- 5.06110692024 14.7546520233 9.05311799049
- 9.19830608368 17.0125601292 11.1488289833
- 5.40441417694 6.59027791023 3.63601899147
+ 0.000210046768188 2.82172012329 1.38699007034
+ 0.123202085495 0.126130104065 8.17586708069
+ 0.123197078705 0.124358177185 8.34655714035
+ 0.0616521835327 0.0626962184906 4.88309693336
+ 0.0617570877075 0.0626759529114 4.88519001007
+ 0.000902891159058 479.282402992 (forever, I yet it run for 5min before quiting)
+ 1.65824794769 (forever) (another forever)
+ 0.000197887420654 6.59566307068 8.29050803185
+ 5.32597303391 12.1487128735 7.1309800148
+ 6.45182704926 15.0498359203 11.733394146
+ 0.000119924545288 2.13657021523 1.67227101326
+ 3.96346402168 14.7546520233 9.05311799049
+ 8.30484199524 17.0125601292 11.1488289833
+ 4.99971699715 6.59027791023 3.63601899147
"""
sumTime = 0.0
More information about the pypy-commit
mailing list