Staging
v0.5.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
Demo
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Python
RISCOS
Tools
.bzrignore -rw-r--r-- 673 bytes
.hgignore -rw-r--r-- 866 bytes
.hgtags -rw-r--r-- 3.7 KB
LICENSE -rw-r--r-- 13.6 KB
Makefile.pre.in -rw-r--r-- 38.1 KB
README -rw-r--r-- 55.6 KB
configure -rwxr-xr-x 657.8 KB
configure.in -rw-r--r-- 103.5 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 28.6 KB
setup.py -rw-r--r-- 80.5 KB

README

back to top