Author belopolsky
Recipients belopolsky, draghuram, mark.dickinson, rhettinger, stutzbach
Date 2010-05-14.02:17:00
SpamBayes Score 0.00100454
Marked as misclassified No
Message-id <AANLkTinJ1DTSl7IzAClSPmrL_QQMT7k3G8JdroYnAZtr@mail.gmail.com>
In-reply-to <1273787928.79.0.0765796576975.issue8692@psf.upfronthosting.co.za>
Content
On Thu, May 13, 2010 at 5:58 PM, Mark Dickinson <report@bugs.python.org> wrote:
> Optimizations that speed up, say, factorial(n) for n <= 1000 would seem more valuable.

I am attaching a variant of my patch which precomputes partial
products that fit in 32 bit unsigned int.  This results in speed up
over Daniel's code which varies from 1.8x for 20! down to 7% for 100!
and no measurable improvement for 1000!.

This optimization is orthogonal to the choice of partial_product
algorithm and can be easily extended on platforms with long long to
precompute 64 bit products.
Files
File name Uploaded
factorial-precompute-partials.patch belopolsky, 2010-05-14.02:16:58
History
Date User Action Args
2010-05-14 02:17:02belopolskysetrecipients: + belopolsky, rhettinger, mark.dickinson, draghuram, stutzbach
2010-05-14 02:17:00belopolskylinkissue8692 messages
2010-05-14 02:17:00belopolskycreate