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 tim.peters
Recipients
Date 2006-05-24.21:45:53
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=31435

Thanks again, Alan!  I did some major fiddling for
portability and to try to eradicate the penalty for "short"
input strings.  It's still slower on 1-digit inputs, by
about 4-5%, but faster than before with at least 2-digit
inputs.  The peak speedup remains at around 800-1000 decimal
digits, but it's 6x faster there now.  Much of that came
from eliminating code :-)  For example, there was no actual
need for the memset(), and reducing the main loop to:

	for (; pz < pzstop; ++pz) {
		c += (twodigits)*pz * convmult;
		*pz = (digit)(c & MASK);
		c >>= SHIFT;
	}

was a huge win under VC 7.1 (in the patch, it has a branch
testing whether c is 0, and I didn't believe the comment
that said the branch made it faster ;-)).

Anyway, this is checked in now.  The table of digit values
is duplicated for the moment, and I hope to refactor that
soon (given that ints and longs have become increasingly
unified in Python, it's become increasingly confusing to
have two string->int routines -- while they have to remain
for backward compatibility, there's nothing to stop
rewriting the core to use a new unified conversion function).
History
Date User Action Args
2007-08-23 15:46:20adminlinkissue1442927 messages
2007-08-23 15:46:20admincreate