[Python-checkins] r81228 - python/branches/release31-maint
mark.dickinson
python-checkins at python.org
Sun May 16 10:39:09 CEST 2010
Author: mark.dickinson
Date: Sun May 16 10:39:09 2010
New Revision: 81228
Log:
Blocked revisions 81196 via svnmerge
........
r81196 | mark.dickinson | 2010-05-15 18:02:38 +0100 (Sat, 15 May 2010) | 13 lines
Issue #8692: Improve performance of math.factorial:
(1) use a different algorithm that roughly halves the total number of
multiplications required and results in more balanced multiplications
(2) use a lookup table for small arguments
(3) fast accumulation of products in C integer arithmetic rather than
PyLong arithmetic when possible.
Typical speedup, from unscientific testing on a 64-bit laptop, is 4.5x
to 6.5x for arguments in the range 100 - 10000.
Patch by Daniel Stutzbach; extensive reviews by Alexander Belopolsky.
........
Modified:
python/branches/release31-maint/ (props changed)
More information about the Python-checkins
mailing list