Yury Selivanov added the comment:

> Does this patch have effect with results over 8 bits? 

-m timeit -s "x=2**40" "x&2;x&2;x&2;x&333;x&3;x&3;x&4444;x&4"
with patch: 0.404usec      without patch: 0.41


> Does it have effect after applying patches from 24165?

I'm not sure how it's related, but let's modify the test to stress the mem 
allocation:

-m timeit -s "x=21827623" 
"(x+x)&2;(x+x)&2;(x+x)&2;(x+x)&333;(x+x)&3;x&3;(x+x)&4444;(x+x)&4"

this patch+freelist: 0.337usec       only freelist: 0.496

In any case, bit operations are often used for bit-flags logic, where numbers 
are usually aren't too big (it's rare to see more than 30 bit flags on one 
field).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26342>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to