[issue4258] Use 30-bit digits instead of 15-bit digits for Python integers.
report at bugs.python.org
Thu Nov 6 12:30:58 CET 2008
STINNER Victor <victor.stinner at haypocalc.com> added the comment:
> I'll investigate the slowdowns
The problem may comes from int64_t on 32 bits CPU. 32x32 -> 64 may be
emulated on your CPU and so it's slower. I improved your patch to make
it faster, but I lost all my work because of a misuse of GIT... As I
- I fixed PyLong_FromLong() for small negative integer
- I unrolled the loop in PyLong_FromLong(): the loop is at least
called twice (the number has 2 digits or more)
- I added special code for operations on two numbers of 1 digit
(each) for long_add(), long_mul(), long_div(), long_bitwise(), etc.
- and I don't remember the other changes...
Oh, I have an old patch. I will attach it to this message. About
speed, it was:
* unpatched: 20600..20900 pystones
* your patch: 19900..20100 pystones
* + my changes: 20200..20400 pytones
Added file: http://bugs.python.org/file11951/optimize.patch
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list