Skip to content
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

Refactor thread_info to remove the RefCell #115753

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Sep 11, 2023

thread_info currently uses RefCell-based initialization. Refactor this to use OnceCell instead which is more performant and better suits the needs of one-time initialization.

This is nobody's bottleneck but OnceCell checks are a single cmp vs. RefCell<Option> needing runtime logic

@rustbot
Copy link
Collaborator

rustbot commented Sep 11, 2023

r? @thomcc

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 11, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

`thread_info` currently uses `RefCell`-based initialization. Refactor
this to use `OnceCell` instead which is more performant and better suits
the needs of one-time initialization.
@thomcc
Copy link
Member

thomcc commented Sep 20, 2023

Thanks.

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Sep 20, 2023

📌 Commit 207b609 has been approved by thomcc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 20, 2023
@bors
Copy link
Contributor

bors commented Sep 20, 2023

⌛ Testing commit 207b609 with merge ed33e40...

@bors
Copy link
Contributor

bors commented Sep 20, 2023

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing ed33e40 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 20, 2023
@bors bors merged commit ed33e40 into rust-lang:master Sep 20, 2023
@rustbot rustbot added this to the 1.74.0 milestone Sep 20, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ed33e40): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.0% [4.9%, 5.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results

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.

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

Bootstrap: 631.695s -> 632.622s (0.15%)
Artifact size: 317.87 MiB -> 317.96 MiB (0.03%)

@tgross35 tgross35 deleted the threadinfo-refactor branch September 20, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants