-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize nth and nth_back for BoundTupleIterator #4897
Optimize nth and nth_back for BoundTupleIterator #4897
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much, just some small comments.
CodSpeed Performance ReportMerging #4897 will degrade performances by 12.82%Comparing 🎉 Hooray!
|
Benchmark | BASE |
HEAD |
Change | |
---|---|---|---|---|
❌ | extract_float_downcast_fail |
396.7 ns | 455 ns | -12.82% |
🆕 | tuple_nth |
N/A | 4.3 µs | N/A |
🆕 | tuple_nth_back |
N/A | 4.3 µs | N/A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks 🚀
See #4787
This PR optimizes
nth
andnth_back
forBoundTupleIterator
, and added unittest & benchmarks for these 2 APIs. Here are the benchmark of the optimizednth
andnth_back
:On Stable toolchain
With Optimization
The default
nth
andnth_back
implementationOn nightly toolchain
With Optimization
The default
nth
andnth_back
implementation