Message47377
The 'inner loop' for applying bitwise ops to longs is quite
inefficient.
The improvement in the attached diff is
- 'a' is never shorter than 'b' (result: only test 1
loop index condition instead of 3)
- each operation ( & | ^ ) has its own loop, instead
of switch inside loop
- I found that, when this is done, a lot
of things can be simplified, resulting in further speedup,
and the resulting code is not very much longer than
before (my libpython2.4.dll .text got 140 bytes longer).
Operations on longs of a few thousand bits appear
to be 2 ... 2.5 times faster with this patch.
I'm not 100% sure the code is right, but it passes
test_long.py, anyway.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:40:55 | admin | link | issue1087418 messages |
2007-08-23 15:40:55 | admin | create | |
|