From: Mark Dickinson Date: Mon, 23 Mar 2009 18:46:40 +0000 (+0000) Subject: Blocked revisions 70547 via svnmerge X-Git-Tag: 3.0~298 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a3bd7ed86be4f9ce2a2f3787fcc19504ac746936;p=thirdparty%2FPython%2Fcpython.git Blocked revisions 70547 via svnmerge ................ r70547 | mark.dickinson | 2009-03-23 18:44:57 +0000 (Mon, 23 Mar 2009) | 21 lines Merged revisions 70542 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ 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. ........ ................ ---