-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Outline panicking code for LocalKey::with
#135224
Conversation
See rust-lang#115491 for prior related modifications. https://godbolt.org/z/MTsz87jGj shows a reduction of the code size for TLS accesses.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cuviper (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
@wyfo can you construct the diff view in Godbolt? you can diff different sources against each other, though maybe it won't be useful if they have different BB orders... here's a link: https://godbolt.org/z/sn5ncezMT also |
I didn't know this godbolt feature... Here is a link: https://godbolt.org/z/9G1sYvT7K. I wonder why the compiler remove the jump here. Maybe there is a |
well, you can rebuild the stdlib, and then compile the compiler with the new stdlib, and then compile the code with the new stdlib, but that's kind of a slow iteration cycle. maybe you can rebuild the stdlib from scratch atop core using |
My bad, I was looking at the wrong place, https://github.com/rust-lang/rust/blob/master/library/std/src/sys/thread_local/native/lazy.rs#L61 is already |
hm? I think it's worth a PR fine, yeah. I'll let the reviewer decide whether to accept this tho'! |
Let's see if we can measure any difference: @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Outline panicking code for `LocalKey::with` See rust-lang#115491 for prior related modifications. https://godbolt.org/z/MTsz87jGj shows a reduction of the code size for TLS accesses.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (fc39c05): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -3.6%, secondary -1.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -0.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary 0.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 763.382s -> 763.181s (-0.03%) |
I'm not really able to interpret those results. Do you think the regression significant? What would be the next step? |
The perf change doesn't look significant to me -- let's do it! @bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (b605c65): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -1.3%, secondary 1.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (primary -0.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 765.476s -> 764.449s (-0.13%) |
See #115491 for prior related modifications.
https://godbolt.org/z/MTsz87jGj shows a reduction of the code size for TLS accesses.