Skip to content

Conversation

@petrochenkov
Copy link
Contributor

@petrochenkov petrochenkov commented Jan 11, 2026

This recovers the second half of perf regressions from #149681 (the first part was recovered in #150741).

@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 Jan 11, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 11, 2026

r? @JonathanBrouwer

rustbot has assigned @JonathanBrouwer.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@petrochenkov
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Jan 11, 2026
[WIP] resolve: In `visit_scopes` do not extract ctxt out of span unless necessary
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 11, 2026
@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 11, 2026
@rust-log-analyzer

This comment was marked as resolved.

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 12, 2026

☀️ Try build successful (CI)
Build commit: 90c065e (90c065e1f1941f1648bc62a8e863ed65d412035b, parent: b68e16cfc0e9f8b29c9ec41bfa6ab0a637eff19c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (90c065e): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@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.7% [0.7%, 0.7%] 1
Improvements ✅
(primary)
-0.3% [-0.5%, -0.1%] 95
Improvements ✅
(secondary)
-0.3% [-0.8%, -0.1%] 48
All ❌✅ (primary) -0.3% [-0.5%, -0.1%] 95

Max RSS (memory usage)

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

Cycles

Results (secondary 3.2%)

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)
3.2% [3.2%, 3.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 473.667s -> 471.559s (-0.45%)
Artifact size: 391.39 MiB -> 391.39 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 12, 2026
@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 12, 2026
@petrochenkov
Copy link
Contributor Author

The benefits here are actually larger than I expected.

This is good, but if we want to apply the same approach to working with SyntaxContexts consistently, then the implications for developer experience are a bit annoying.

The optimal way of modifying syntax contexts is:

  • If we do not modify it, then do not extract it from Span.
  • If we modify it more than once, then extract it from Span, modify, and then re-package into Span again in the end.
  • If we modify it once, then do not extract it from Span, but rather do an in-place update (but extracting, modifying and repackaging, like in the previous item, is probably not much worse).

Of course we don't know which scenario applies until runtime.
Perhaps we need some wrapper type around Span doing all of the above conveniently...

@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 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.

@petrochenkov petrochenkov changed the title [WIP] resolve: In visit_scopes do not extract ctxt out of span unless necessary resolve: In visit_scopes do not extract ctxt out of span unless necessary Jan 14, 2026
@petrochenkov
Copy link
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 Jan 14, 2026
@JonathanBrouwer
Copy link
Contributor

@bors r+ rollup=never

@rust-bors rust-bors bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 14, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 14, 2026

📌 Commit 0361bd0 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 14, 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 Jan 15, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 15, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Pushing b5c2a0f to main...

@rust-bors rust-bors bot merged commit b5c2a0f into rust-lang:main Jan 15, 2026
12 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Jan 15, 2026
@github-actions
Copy link
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 7704328 (parent) -> b5c2a0f (this PR)

Test differences

Show 52 test diffs

52 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 b5c2a0fc0ac851e83ef943e3a2b90c1abab06baa --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. dist-x86_64-apple: 7807.6s -> 6531.4s (-16.3%)
  2. x86_64-gnu-llvm-20: 4736.8s -> 4059.8s (-14.3%)
  3. aarch64-apple: 12780.4s -> 10965.5s (-14.2%)
  4. dist-aarch64-msvc: 5599.8s -> 6292.4s (+12.4%)
  5. dist-aarch64-llvm-mingw: 6280.7s -> 6973.4s (+11.0%)
  6. x86_64-gnu-nopt: 7787.8s -> 8611.7s (+10.6%)
  7. x86_64-gnu-tools: 3739.5s -> 3344.0s (-10.6%)
  8. dist-aarch64-apple: 8244.2s -> 9115.2s (+10.6%)
  9. pr-check-1: 1910.9s -> 1716.1s (-10.2%)
  10. armhf-gnu: 5508.0s -> 4954.3s (-10.1%)
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
Collaborator

Finished benchmarking commit (b5c2a0f): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -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.3% [-0.5%, -0.1%] 59
Improvements ✅
(secondary)
-0.4% [-0.7%, -0.2%] 27
All ❌✅ (primary) -0.3% [-0.5%, -0.1%] 59

Max RSS (memory usage)

Results (primary -2.8%)

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)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.8% [-2.8%, -2.8%] 1

Cycles

Results (secondary -4.2%)

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.2% [-5.0%, -3.4%] 2
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 471.886s -> 472.792s (0.19%)
Artifact size: 383.58 MiB -> 383.56 MiB (-0.01%)

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. 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.

5 participants