Message49638
Logged In: YES
user_id=1115903
Version #2 is attached. I made a couple of tweaks and
tested the patch out on Linux just to make sure the
performace is still as good with compiler optimizations.
For short numbers (numbers that would fit into an int),
long() is 10-30% *slower* than before applying the patch.
For longer numbers, long() is up to 249% faster, with the
peak occurring around 1000 digits.
If the negative performance impact for int-sized digits is
unacceptable, I will see if I can do something about it.
However, one always has the option of using int() on very
long strings anyway, and it will automatically fall through
to PyLong_FromString if the number is too long. The
performance impact on int() for small numbers is so small as
to be negligible (<5%), which is to be expected since the
modified code isn't called when using int() on input strings
< 2**32. |
|
Date |
User |
Action |
Args |
2007-08-23 15:46:19 | admin | link | issue1442927 messages |
2007-08-23 15:46:19 | admin | create | |
|