perf: use new PyLong* API for num-bigint feature#6144
Conversation
Merging this PR will improve performance by 86.02%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
davidhewitt
left a comment
There was a problem hiding this comment.
Thanks, generally looks good on the from-python implementation; I think possible gains yet to be had in the to-python implementation.
|
|
||
| #[cfg(all(not(Py_LIMITED_API), Py_3_14))] | ||
| { | ||
| if is_30bit_layout() { |
There was a problem hiding this comment.
Some observations on this path:
- I would prefer to have this logic extracted into a generic function; I think it's easier to maintain than when it's deeply nested inside a macro.
- I think we can avoid the intermediate
Vecallocation from the digits and instead wrap the iterator coming out of the big-integer.pylong_from_digitsneeds anExactSizeIterator, so it'll be a touch fiddly but I think still possible. - I think we lack benchmarks for the bigint to-python pathway, so possibly worth landing some of those before we think too hard about this.
There was a problem hiding this comment.
- I think we lack benchmarks for the bigint to-python pathway, so possibly worth landing some of those before we think too hard about this.
|
Also, I think worth giving this a |
PyLong API for num-bigint featurePyLong* API for num-bigint feature
How exactly are GitHub machines assigned for running jobs, is it random? Doesn't I mean, is there anything that can be done about the |
Related: #6040
See codspeed comment for benchmark improvements.