Message105668
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. |
|
Date |
User |
Action |
Args |
2010-05-13 23:40:23 | belopolsky | set | recipients:
+ belopolsky, rhettinger, mark.dickinson, draghuram, stutzbach |
2010-05-13 23:40:20 | belopolsky | link | issue8692 messages |
2010-05-13 23:40:19 | belopolsky | create | |
|