-
Notifications
You must be signed in to change notification settings - Fork 13.4k
"const" initialized thread locals in rustc #84833
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Let's see if this gives us any speedup - some of the TLS state modified in this commit *is* pretty heavily accessed, so we can hope!
r? @varkor (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 5065144 with merge d001198a19b8608565f98c76c5700d69176acd3e... |
☀️ Try build successful - checks-actions |
Queued d001198a19b8608565f98c76c5700d69176acd3e with parent e10cbc3, future comparison URL. |
Finished benchmarking try commit (d001198a19b8608565f98c76c5700d69176acd3e): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
Looks like a pretty solid improvement to me; this generates essentially strictly less code so I'm not too surprised. |
@bors r+ |
📌 Commit 5065144 has been approved by |
This is a comparison of the codegen FWIW -- https://godbolt.org/z/5MEjMMocE Also in general the major cost of TLS with Rust is when it comes to cross-crate usage. We've never been great at this, largely due to a missing feature in the compiler (inlining more directives). If rustc winds up using cross-crate TLS (e.g. via monomorphization and such) that's the biggest cost to overcome. |
FWIW for rustc itself I suspect our codegen is a bit better as we pass -Ztls-model=initial-exec - https://godbolt.org/z/deq5jMhsj - still an improvement for sure! |
⌛ Testing commit 5065144 with merge 11959306b3008b2476b40157ed49c6fd7ee579c8... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors retry network error |
As a follow-up, it might be useful to look at adding a |
☀️ Test successful - checks-actions |
This appears to give a slight speedup on many of our benchmarks.