Skip to content

std: micro-optimize thread local accesses#157537

Closed
joboet wants to merge 1 commit into
rust-lang:mainfrom
joboet:microoptimize_tls
Closed

std: micro-optimize thread local accesses#157537
joboet wants to merge 1 commit into
rust-lang:mainfrom
joboet:microoptimize_tls

Conversation

@joboet

@joboet joboet commented Jun 6, 2026

Copy link
Copy Markdown
Member

Alternative to #143511.

I had some further ideas on how to optimise TLS accesses...

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 6, 2026
@joboet

joboet commented Jun 6, 2026

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 6, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 6, 2026
std: micro-optimize thread local accesses
@rust-bors

rust-bors Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 45cb56f (45cb56f797a0bb4c02cd34f99c3fe416b3065c38, parent: 8954863c81df429ebf96ea38a16c76f209995833)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (45cb56f): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.3%, secondary 3.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
6.6% [6.1%, 7.6%] 3
Regressions ❌
(secondary)
3.6% [2.0%, 6.5%] 3
Improvements ✅
(primary)
-4.2% [-5.4%, -3.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.3% [-5.4%, 7.6%] 5

Cycles

Results (primary 3.4%, secondary 3.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.4% [1.9%, 6.7%] 101
Regressions ❌
(secondary)
3.4% [1.8%, 7.7%] 95
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) 3.4% [1.9%, 6.7%] 101

Binary size

Results (primary 0.0%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.4%] 44
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 38
Improvements ✅
(primary)
-0.4% [-1.0%, -0.1%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-1.0%, 0.4%] 47

Bootstrap: 514.086s -> 515.048s (0.19%)
Artifact size: 400.74 MiB -> 400.69 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 6, 2026
@joboet

joboet commented Jun 7, 2026

Copy link
Copy Markdown
Member Author

Cycle times appear to be way worse, so this doesn't work out apparently...

@joboet joboet closed this Jun 7, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants