-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rewrite native thread-local storage #116123
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@rustbot author |
fn __init() -> $t { | ||
$init | ||
} |
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.
I have been impl'ing a lint in clippy to suggest const
if possible, and it relies on this structure existing and returning exactly $init
. As long as this doesn't change, the lint should keep working.
☔ The latest upstream changes (presumably #117285) made this pull request unmergeable. Please resolve the merge conflicts. |
@joboet any updates on this? thanks |
@rustbot label +S-blocked I want to do some other cleanups before this can be merged. |
08bc1c6
to
7b69733
Compare
This comment has been minimized.
This comment has been minimized.
I'm curious as to whether this affects performance. This should reduce the number of TLS accesses, after all. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #124428) made this pull request unmergeable. Please resolve the merge conflicts. |
Thanks for working on this! This looks great.
Agreed! r=me after rebasing |
911ead7
to
60bf1ab
Compare
This comment has been minimized.
This comment has been minimized.
I haven't checked the code, but does the clippy lint work? |
Yes, it should work. |
Splendid, thank you very much! |
☀️ Test successful - checks-actions |
Finished benchmarking commit (9c8a58f): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary 6.9%, secondary 3.7%)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 2.9%, secondary 3.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.
Binary sizeResults (primary 0.1%, secondary 0.1%)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: 673.262s -> 673.733s (0.07%) |
(part of #110897)
The current native thread-local storage implementation has become quite messy, uses indescriptive names and unnecessarily adds code to the macro expansion. This PR tries to fix that by using a new implementation that also allows more layout optimizations and potentially increases performance by eliminating unnecessary TLS accesses.
This does not change the recursive initialization behaviour I described in this comment, so it should be a library-only change. Changing that behaviour should be quite easy now, however.
r? @m-ou-se
@rustbot label +T-libs