Staging
v0.8.1
https://github.com/python/cpython
Revision 2761cd300484e870d15baab1761cd91a3ede9e20 authored by Mark Dickinson on 23 March 2009, 18:26:07 UTC, committed by Mark Dickinson on 23 March 2009, 18:26:07 UTC
........
  r70542 | mark.dickinson | 2009-03-23 18:25:13 +0000 (Mon, 23 Mar 2009) | 14 lines

  Issue #5512: speed up the long division algorithm for Python longs.
  The basic algorithm remains the same; the most significant speedups
  come from the following three changes:

    (1) normalize by shifting instead of multiplying and dividing
    (2) the old algorithm usually did an unnecessary extra iteration of
        the outer loop; remove this.  As a special case, this means that
        long divisions with a single-digit result run twice as fast as
        before.
    (3) make inner loop much tighter.

  Various benchmarks show speedups of between 50% and 150% for long
  integer divisions and modulo operations.
........
1 parent 4f908dd
History
Tip revision: 2761cd300484e870d15baab1761cd91a3ede9e20 authored by Mark Dickinson on 23 March 2009, 18:26:07 UTC
Blocked revisions 70542 via svnmerge
Tip revision: 2761cd3
File Mode Size
stringlib
abstract.c -rw-r--r-- 68.1 KB
boolobject.c -rw-r--r-- 4.7 KB
bufferobject.c -rw-r--r-- 18.9 KB
bytearrayobject.c -rw-r--r-- 96.3 KB
bytes_methods.c -rw-r--r-- 15.7 KB
cellobject.c -rw-r--r-- 2.9 KB
classobject.c -rw-r--r-- 63.4 KB
cobject.c -rw-r--r-- 3.8 KB
codeobject.c -rw-r--r-- 18.3 KB
complexobject.c -rw-r--r-- 28.8 KB
descrobject.c -rw-r--r-- 33.5 KB
dictnotes.txt -rw-r--r-- 11.9 KB
dictobject.c -rw-r--r-- 66.4 KB
enumobject.c -rw-r--r-- 10.0 KB
exceptions.c -rw-r--r-- 58.7 KB
fileobject.c -rw-r--r-- 67.0 KB
floatobject.c -rw-r--r-- 58.4 KB
frameobject.c -rw-r--r-- 26.3 KB
funcobject.c -rw-r--r-- 21.2 KB
genobject.c -rw-r--r-- 10.1 KB
intobject.c -rw-r--r-- 32.9 KB
iterobject.c -rw-r--r-- 5.2 KB
listobject.c -rw-r--r-- 71.5 KB
listsort.txt -rw-r--r-- 31.0 KB
longobject.c -rw-r--r-- 89.4 KB
methodobject.c -rw-r--r-- 9.4 KB
moduleobject.c -rw-r--r-- 6.3 KB
object.c -rw-r--r-- 53.5 KB
obmalloc.c -rw-r--r-- 57.4 KB
rangeobject.c -rw-r--r-- 8.1 KB
setobject.c -rw-r--r-- 58.0 KB
sliceobject.c -rw-r--r-- 8.3 KB
stringobject.c -rw-r--r-- 126.7 KB
structseq.c -rw-r--r-- 12.5 KB
tupleobject.c -rw-r--r-- 22.7 KB
typeobject.c -rw-r--r-- 172.9 KB
unicodectype.c -rw-r--r-- 16.0 KB
unicodeobject.c -rw-r--r-- 268.0 KB
unicodetype_db.h -rw-r--r-- 98.8 KB
weakrefobject.c -rw-r--r-- 29.3 KB

back to top