Uh oh!
There was an error while loading. Please reload this page.
Backport WorkerLocal - #155649
Conversation
rustbot
commented
Apr 22, 2026
rustbot has assigned @nikomatsakis. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Zoxc
commented
Apr 27, 2026
I'd just copy over the whole new file to keep the updated safety comments and microoptimizations, then just change it to share just the Registry type, so it doesn't make use of |
If I did that I would copy old code back due to this registry struct. I've copied all of the safety comments and microoptimizations. The aforementioned null check is unavoidable as it is done for |
This comment has been minimized.
This comment has been minimized.
nikomatsakis
commented
Apr 27, 2026
@Zoxc (do you want to take this review, or should I?) |
Zoxc
commented
Apr 29, 2026
Not on |
nikomatsakis
commented
May 7, 2026
r? @Zoxc Feel free to assign back to me, Zoxc, or re-roll. |
rustbot
commented
Jun 1, 2026
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
zetanumbers
commented
Jun 1, 2026
I've rewritten this PR more conservatively. I've just replaced the old version with the new one. However I had to rename I think this PR is done but CI for some reason is broken. @rustbot ready |
Zoxc
commented
Jul 17, 2026
I'm a bit confused to why this is a problem? |
☔ The latest upstream changes (presumably #160284) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
#107782 added a
WorkerLocalinto rustc_data_structures. Due to it being ported from the old rustc rayon fork it required also portingRegistryand sort of hack it in there. This PR replaces new version with the old one while trying to backport whatever microoptimizations were added. But I doubt #107782's manual benchmarks as those aren't significantly big to differentiate from the noise, although that's from my experience.One difference I haven't yet addressed is an indirection through thread-local
WORKER_THREAD_STATEpointer. I've found that changing its type toManuallyDrop<OnceCell<WorkerThread>>itself is essentially a clean up/refactor which I've stashed for now.cc @Zoxc