This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alanmcintyre
Recipients
Date 2006-03-06.22:33:29
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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. 
History
Date User Action Args
2007-08-23 15:46:19adminlinkissue1442927 messages
2007-08-23 15:46:19admincreate