Author belopolsky
Recipients belopolsky, draghuram, mark.dickinson, rhettinger, stutzbach
Date 2010-05-13.23:40:18
SpamBayes Score 0.000934436
Marked as misclassified No
Message-id <AANLkTik1JBdgs0vk-87MABS3HFxavO0DjG1XH887FB95@mail.gmail.com>
In-reply-to <1273693664.96.0.298446297195.issue8692@psf.upfronthosting.co.za>
Content
On Wed, May 12, 2010 at 3:47 PM, Mark Dickinson <report@bugs.python.org> wrote:
>...
> Realistically though, I don't see an iterative version of factorial_part_product as
> an option for the C patch, without a significant increase in complexity.  Daniel's
> current patch is remarkably clean and simple, and I'd like to keep it that way.
>

I am attaching an iterative version in C patch.  I don't think it
represents a dramatic increase in complexity ~ 40 lines over Daniel's
30.

> I did think about various evil schemes for an iterative version, ...

I would not say my patch is evil, maybe a bit naughty. :-) It can be
made less evil by resizing the list instead of filling its tail with
NULLs or more evil by using a tuple instead of list.

The performance  appears to be identical to Daniel's with no small
integer multiplication optimization.  The later gives about 2%
improvement.
Files
File name Uploaded
factorial-no-recursion.patch belopolsky, 2010-05-13.23:40:15
History
Date User Action Args
2010-05-13 23:40:23belopolskysetrecipients: + belopolsky, rhettinger, mark.dickinson, draghuram, stutzbach
2010-05-13 23:40:20belopolskylinkissue8692 messages
2010-05-13 23:40:19belopolskycreate