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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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