[issue26342] Faster bit ops for single-digit positive longs

2016-12-16 Thread Yury Selivanov
Yury Selivanov added the comment: Closing this one, as we decided to not to micro-optimize int ops. -- resolution: -> wont fix stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue26342] Faster bit ops for single-digit positive longs

2016-02-12 Thread Yury Selivanov
Yury Selivanov added the comment: > You should add a tests. especially for edge cases, for negative values for > example. There are many binop tests in test_long.py -- ___ Python tracker

[issue26342] Faster bit ops for single-digit positive longs

2016-02-12 Thread Марк Коренберг
Марк Коренберг added the comment: You should add a tests. especially for edge cases, for negative values for example. -- nosy: +mmarkk ___ Python tracker

[issue26342] Faster bit ops for single-digit positive longs

2016-02-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Does this patch have effect with results over 8 bits? Does it have effect after applying patches from 24165? -- ___ Python tracker

[issue26342] Faster bit ops for single-digit positive longs

2016-02-12 Thread Yury Selivanov
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&;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

[issue26342] Faster bit ops for single-digit positive longs

2016-02-12 Thread Yury Selivanov
Yury Selivanov added the comment: > with patch: 0.404usec without patch: 0.41 Sorry, I made a typo: these results should be flipped -- 0.41-0.404 is the overhead of the fastpath's 'if' check. I'd say it's a pretty small overhead -- we already optimize all other long ops, including bit

[issue26342] Faster bit ops for single-digit positive longs

2016-02-11 Thread Yury Selivanov
New submission from Yury Selivanov: This patch implements a fast path for &, |, and ^ bit operations for single-digit positive longs. We already have fast paths for ~, and pretty much every other long op. -m timeit -s "x=21827623" "x&2;x&2;x&2;x&333;x&3;x&3;x&;x&4" with patch: 0.181

[issue26342] Faster bit ops for single-digit positive longs

2016-02-11 Thread STINNER Victor
STINNER Victor added the comment: fast_bits.patch LGTM. But it would be better to have at least two reviews. -- ___ Python tracker ___