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 mark.dickinson
Recipients collinwinter, eric.smith, gawain, gregory.p.smith, mark.dickinson, vstinner
Date 2009-09-09.20:47:53
SpamBayes Score 0.0
Marked as misclassified No
Message-id <1252529276.15.0.162199154591.issue6713@psf.upfronthosting.co.za>
In-reply-to
Content
I'm a bit ambivalent about this patch:  I'd like to see string to integer 
conversions improved, and on the surface it makes sense to special-case 
base 10 conversions (just as power-of-two bases are already special-
cased), but this seems like quite a lot of extra code to debug and 
maintain just to speed up one aspect of the integer implementation.  It 
would be easy to grow longobject.c by several thousand lines by adding a 
handful of optimizations of this type.

If you're working with huge integers and care about speed, then you should 
probably be using gmpy or similar (or something other than Python).  And 
this patch doesn't solve the real problem with converting huge integers to 
and from decimal strings, which is that the algorithms used have quadratic 
running time.  Amongst quadratic-time algorithms, I'm tempted to call 
Python's implementation 'good enough'.

Gawain, do you have a particular use-case in mind for this optimization?  
Are there common applications where string <-> int conversion times are 
critical?
History
Date User Action Args
2009-09-09 20:47:56mark.dickinsonsetrecipients: + mark.dickinson, collinwinter, gregory.p.smith, vstinner, eric.smith, gawain
2009-09-09 20:47:56mark.dickinsonsetmessageid: <1252529276.15.0.162199154591.issue6713@psf.upfronthosting.co.za>
2009-09-09 20:47:53mark.dickinsonlinkissue6713 messages
2009-09-09 20:47:53mark.dickinsoncreate