-
Notifications
You must be signed in to change notification settings - Fork 598
perf: More Context benchmarks #2707
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
perf: More Context benchmarks #2707
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2707 +/- ##
=====================================
Coverage 79.3% 79.3%
=====================================
Files 123 123
Lines 22660 22660
=====================================
Hits 17977 17977
Misses 4683 4683 ☔ View full report in Codecov by Sentry. |
1980b5a to
db82c76
Compare
| }; | ||
|
|
||
| // Run this benchmark with: | ||
| // cargo bench --bench current_context |
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.
| // cargo bench --bench current_context | |
| // cargo bench --bench context_attach |
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.
🤦🏼♂️ Thanks. I'll change it.
| context_type: &str, | ||
| context: &Context, | ||
| ) { | ||
| let _restore = Context::current().attach(); |
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.
| let _restore = Context::current().attach(); | |
| let _context_guard = Context::current().attach(); |
nits!
| fn single_cx(cx: Context) { | ||
| let cx = black_box(cx.attach()); | ||
| let _ = black_box(dummy_work()); | ||
| drop(cx); |
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.
is it intentional to do explicit drop of cx? Any reason why it is done so?
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.
The drop will happen anyway, so I can remove it.
| } | ||
|
|
||
| #[inline(never)] | ||
| fn overlapping_cx(cx1: Context, cx2: Context) { |
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.
nit: Rename to "out_of_order_cx_drop"
cijothomas
left a comment
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.
Looks good!
Left some nits, not a blocker. Eager to see improvements here in upcoming PRs!
|
LGTM too. Once this and #2706 is in you can merge down from main into your context fix branch and we should get the perf change announcements. I'll make sure the other one is ready to go this morning. |
Changes
This breaks out the context benchmark work from #2378 so the performance changes can be seen in the PR.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial, user-facing changes