[mypyc] feat: new primitive for int.bit_length#19673
Conversation
JukkaL
left a comment
There was a problem hiding this comment.
Thanks for the PR! bit_length can be useful in low-level code, where a generic method call can really slow things down.
|
I'm not entirely sure how to proceed here, I can't think of any reason our use of |
JukkaL
left a comment
There was a problem hiding this comment.
I think I found an issue. Also can you measure the perf difference using a micro-benchmark?
Will this benchmark suffice? I can deploy this commit hash and compare against 1.18 which I already have benchmarked here |
1.18 vs this branch There was a ~6% increase in speed for various permutations of the |
This PR adds a new primitive for
int.bit_lengthand is already ready for review.