Skip to content

Remove CacheCell and CacheRefCell aliases and directly use Lock and RwLock - #162418

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
LorrensP-2158466:cache-cell-bench
Sep 13, 2026
Merged

Remove CacheCell and CacheRefCell aliases and directly use Lock and RwLock#162418
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
LorrensP-2158466:cache-cell-bench

Conversation

@LorrensP-2158466

@LorrensP-2158466 LorrensP-2158466 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

View all comments

Some changes from #158845 for benchmarking.

decided to change Mutex to datastructures::sync::Lock.

r? @petrochenkov

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 7, 2026
@mati865

mati865 commented Sep 7, 2026

Copy link
Copy Markdown
Member

@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 Sep 7, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 7, 2026
[BENCH] remove `CacheCell` and `CacheRefCell` aliases and directly use `Lock` and `RwLock`
@petrochenkov

Copy link
Copy Markdown
Contributor

Even if there are minor regressions, we can merge this once the concerns about locking in macro scope compression (#158845 (comment)) are resolved.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 7, 2026
@rust-bors

rust-bors Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 798fc4c (798fc4c7778a8edd55282f90fd5f1f886488e775)
Base parent: 656a9da (656a9da186dacaf3bf8f7f7296a825d256cb4ae3)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (798fc4c): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@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.4% [0.1%, 1.5%] 42
Regressions ❌
(secondary)
0.2% [0.1%, 0.2%] 12
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.1%] 2
All ❌✅ (primary) 0.4% [0.1%, 1.5%] 42

Max RSS (memory usage)

Results (primary 2.0%, secondary 0.5%)

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

mean range count
Regressions ❌
(primary)
2.0% [2.0%, 2.0%] 1
Regressions ❌
(secondary)
4.3% [2.8%, 6.8%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.8% [-7.3%, -4.4%] 3
All ❌✅ (primary) 2.0% [2.0%, 2.0%] 1

Cycles

Results (primary 0.6%, secondary 5.6%)

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

mean range count
Regressions ❌
(primary)
1.4% [0.5%, 2.6%] 11
Regressions ❌
(secondary)
5.6% [5.6%, 5.6%] 1
Improvements ✅
(primary)
-3.5% [-3.6%, -3.4%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [-3.6%, 2.6%] 13

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 478.991s -> 480.615s (0.34%)
Artifact size: 403.45 MiB -> 404.22 MiB (0.19%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 7, 2026
@Kobzol

Kobzol commented Sep 7, 2026

Copy link
Copy Markdown
Member

(The tokio benchmark was added today and might be a bit noisy at the start)

@LorrensP-2158466

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 8, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

Still need to address the scope chain compression problem #158845 (comment).
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 9, 2026
@rustbot

rustbot commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Comment thread compiler/rustc_resolve/src/ident.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

@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 Sep 10, 2026
@rust-bors

This comment has been minimized.

… and `RwLock` instead in places that need synchronization
@rustbot

rustbot commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

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.

@LorrensP-2158466

Copy link
Copy Markdown
Contributor Author

r=me after tweaking the comment and squashing commits (and when the perf run completes).

Can't r=you, @rustbot ready.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 11, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+
This is a minor perf regression, but it's a pre-requisite to any parallelization in name resolution.

@rust-bors

rust-bors Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ba21a6e has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 13, 2026
@Zalathar

Copy link
Copy Markdown
Member

Scheduling: Let's run this before a small rollup.

@bors p=5

rust-bors Bot pushed a commit that referenced this pull request Sep 13, 2026
…nkov

Remove `CacheCell` and `CacheRefCell` aliases and directly use `Lock` and `RwLock`



Some changes from #158845 for benchmarking.

decided to change Mutex to `datastructures::sync::Lock`.

r? @petrochenkov
@rust-bors

This comment has been minimized.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-aarch64-apple-macos-26-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

Important

For more information how to resolve CI failures of this job, visit this link.

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 13, 2026
@rust-bors

rust-bors Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 9aa41fe failed: CI. Failed job:

@Zalathar

Copy link
Copy Markdown
Member

@bors p=0

@petrochenkov

Copy link
Copy Markdown
Contributor

Panic in set_alloc_error_hook, suspicious but should be irrelevant to this PR.
@bors r+

@rust-bors

rust-bors Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ba21a6e has been approved by petrochenkov

It is now in the queue for this repository.

A failed build status on this PR was cleared due to the approval.

@rust-bors rust-bors Bot 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 13, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 13, 2026
@rust-bors

rust-bors Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: petrochenkov
Duration: 3h 10m 31s
Pushing 4b6d04e to main...

@rust-bors
rust-bors Bot merged commit 4b6d04e into rust-lang:main Sep 13, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 20d35a3 (parent) -> 4b6d04e (this PR)

Test differences

Show 4 test diffs

4 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 4b6d04e706108ccfeafe2547fbe857dfe8972bad --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. test-pr-check-1: 23m 17s -> 34m 56s (+50.0%)
  2. test-x86_64-gnu-llvm-21-3: 1h 12m -> 1h 42m (+41.2%)
  3. test-x86_64-msvc-ext1: 1h 43m -> 2h 24m (+39.2%)
  4. dist-riscv64-linux-gnu: 1h 8m -> 1h 34m (+38.3%)
  5. test-x86_64-msvc-ext2: 1h 22m -> 1h 52m (+36.7%)
  6. test-x86_64-gnu: 1h 55m -> 2h 34m (+33.4%)
  7. test-aarch64-apple-macos-26-2: 2h 27m -> 1h 38m (-33.2%)
  8. dist-x86_64-freebsd: 1h 9m -> 1h 31m (+31.7%)
  9. test-x86_64-gnu-aux: 2h 5m -> 2h 43m (+30.6%)
  10. test-armhf-gnu: 1h 11m -> 1h 31m (+29.0%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (4b6d04e): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.4% [0.1%, 1.2%] 39
Regressions ❌
(secondary)
0.2% [0.1%, 0.4%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 4
All ❌✅ (primary) 0.4% [0.1%, 1.2%] 39

Max RSS (memory usage)

Results (primary 2.6%)

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

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

Cycles

Results (secondary -4.7%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.7% [-5.3%, -4.2%] 2
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 497.229s -> 501.089s (0.78%)
Artifact size: 406.94 MiB -> 406.85 MiB (-0.02%)

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. perf-regression Performance regression. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants