Skip to content

Use fine grained component-wise span tracking in use trees#153838

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
oli-obk:use-tree-span
Apr 8, 2026
Merged

Use fine grained component-wise span tracking in use trees#153838
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
oli-obk:use-tree-span

Conversation

@oli-obk
Copy link
Copy Markdown
Contributor

@oli-obk oli-obk commented Mar 13, 2026

This often produces nicer spans and even doesn't need a Span field anymore (not that I expect the unused field to affect any perf, but still neat).

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 13, 2026

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 13, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 13, 2026

r? @davidtwco

rustbot has assigned @davidtwco.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 15 candidates

|
LL - with_crate!{$crate input TokenItem}
LL + with_crate!{token_site_span::TokenItem as _ input TokenItem}
LL + with_crate!{token_site_span::TokenItem as _}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These suggestions are now even more broken than before, but considering it was broken before, I think we should just leave it

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 17, 2026

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@rustbot rustbot added the T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. label Mar 17, 2026
@oli-obk
Copy link
Copy Markdown
Contributor Author

oli-obk commented Mar 17, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Mar 17, 2026
Use fine grained component-wise span tracking in use trees
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 17, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Mar 17, 2026

☀️ Try build successful (CI)
Build commit: cefe872 (cefe8725ef5e7dbcaead19ae9024d25a96ac5731, parent: b711f95f86b6489b91fdc55c876ed5f95a8d4560)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (cefe872): comparison URL.

Overall result: ❌ regressions - 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.5% [0.1%, 0.9%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 0.4%, secondary -0.2%)

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

mean range count
Regressions ❌
(primary)
0.4% [0.4%, 0.4%] 2
Regressions ❌
(secondary)
1.4% [1.1%, 1.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.3% [-1.5%, -1.0%] 3
All ❌✅ (primary) 0.4% [0.4%, 0.4%] 2

Cycles

Results (secondary 11.5%)

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)
11.5% [11.5%, 11.5%] 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: 481.409s -> 480.983s (-0.09%)
Artifact size: 394.91 MiB -> 394.79 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 17, 2026
self.prefix.span.to(self.hi_span())
}

pub fn hi_span(&self) -> Span {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you document what are the results of span() and hi_span(), and how they can be different?

Copy link
Copy Markdown
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me after resolving @cjgillot's comments

View changes since this review

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 8, 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.

@oli-obk
Copy link
Copy Markdown
Contributor Author

oli-obk commented Apr 8, 2026

@bors r=davidtwco

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 8, 2026

📌 Commit 033ccb0 has been approved by davidtwco

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 Apr 8, 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 Apr 8, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 8, 2026

☀️ Test successful - CI
Approved by: davidtwco
Duration: 3h 9m 53s
Pushing 9004856 to main...

@rust-bors rust-bors Bot merged commit 9004856 into rust-lang:main Apr 8, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

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 033b925 (parent) -> 9004856 (this PR)

Test differences

Show 7 test diffs

7 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 900485642855f4729d926ecf24680a791f9293cf --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-various: 1h 43m -> 2h 9m (+25.4%)
  2. pr-check-1: 27m 10s -> 33m 52s (+24.7%)
  3. aarch64-gnu-llvm-21-1: 51m 21s -> 1h 2m (+21.9%)
  4. dist-arm-linux-gnueabi: 1h 27m -> 1h 9m (-21.5%)
  5. x86_64-gnu-llvm-21: 1h 15m -> 1h 30m (+20.3%)
  6. x86_64-gnu-tools: 56m 19s -> 1h 6m (+18.5%)
  7. x86_64-rust-for-linux: 46m 21s -> 53m 40s (+15.8%)
  8. dist-various-1: 1h 5m -> 1h 13m (+13.3%)
  9. i686-gnu-2: 1h 28m -> 1h 40m (+12.9%)
  10. dist-apple-various: 1h 49m -> 1h 35m (-12.8%)
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 (9004856): comparison URL.

Overall result: ❌ regressions - 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.7% [0.1%, 1.0%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 1.8%)

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

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

Cycles

Results (primary -1.7%, secondary 2.4%)

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

Binary size

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

Bootstrap: 489.04s -> 489.506s (0.10%)
Artifact size: 395.48 MiB -> 395.50 MiB (0.00%)

@oli-obk oli-obk deleted the use-tree-span branch April 9, 2026 12:17
@oli-obk
Copy link
Copy Markdown
Contributor Author

oli-obk commented Apr 9, 2026

The regressed benchmark has a lot of warnings that go through those code paths. It's somewhat expected that it's more expensive to generate a span for a lint, but these all only happen on the emission path

flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 16, 2026
Use fine grained component-wise span tracking in use trees

This often produces nicer spans and even doesn't need a Span field anymore (not that I expect the unused field to affect any perf, but still neat).
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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt 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