Message49643
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). |
|
Date |
User |
Action |
Args |
2007-08-23 15:46:20 | admin | link | issue1442927 messages |
2007-08-23 15:46:20 | admin | create | |
|