Message92464
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? |
|
Date |
User |
Action |
Args |
2009-09-09 20:47:56 | mark.dickinson | set | recipients:
+ mark.dickinson, collinwinter, gregory.p.smith, vstinner, eric.smith, gawain |
2009-09-09 20:47:56 | mark.dickinson | set | messageid: <1252529276.15.0.162199154591.issue6713@psf.upfronthosting.co.za> |
2009-09-09 20:47:53 | mark.dickinson | link | issue6713 messages |
2009-09-09 20:47:53 | mark.dickinson | create | |
|