[issue1087418] long int bitwise ops speedup (patch included)

Mark Dickinson report at bugs.python.org
Sat Oct 24 21:25:42 CEST 2009


Mark Dickinson <dickinsm at gmail.com> added the comment:

> Most operations are add and subtract, and in each such operation you
> need to look at both signs, and decide if you want to really add or
> subtract, and if you are subtracting, you then have to do a magnitude
> test to see which way - all of that before you do any actual
> computation. That's a lot of overhead for e.g. 'i -= 1'.

Hmm.  I agree this isn't ideal, and I now see the attraction of
two's complement.  Thanks.

It would be interesting to see timings from such an approach.
Maybe one could just implement the basic operations (+, -, *, /)
to get an idea of whether it's worth considering more seriously.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1087418>
_______________________________________


More information about the Python-bugs-list mailing list