Skip to content

Also hash spans inside the same file as relative. #143882

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Jul 13, 2025

Spans that have a parent and that are contained in that parent are hashed as relative to the start position of their parent.

This works well for function bodies, but does not handle attributes.

This PR proposes to extend relative hashing when the span and the parent are in the same file.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 13, 2025
@cjgillot
Copy link
Contributor Author

@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 Jul 13, 2025
bors added a commit that referenced this pull request Jul 13, 2025
Also hash spans inside the same file as relative.

r? `@ghost` for perf
@bors
Copy link
Collaborator

bors commented Jul 13, 2025

⌛ Trying commit 3a47352 with merge df67202...

@bors
Copy link
Collaborator

bors commented Jul 13, 2025

☀️ Try build successful - checks-actions
Build commit: df67202 (df6720223021f98b2dc8ea94b69f1991f056f3bf)

@rust-timer

This comment has been minimized.

@rust-timer

This comment has been minimized.

@rustbot rustbot added perf-regression Performance regression. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 13, 2025
@cjgillot
Copy link
Contributor Author

@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 Jul 13, 2025
bors added a commit that referenced this pull request Jul 13, 2025
Also hash spans inside the same file as relative.

r? `@ghost` for perf
@bors
Copy link
Collaborator

bors commented Jul 13, 2025

⌛ Trying commit 3481584 with merge 5426bf8...

@bors
Copy link
Collaborator

bors commented Jul 13, 2025

☀️ Try build successful - checks-actions
Build commit: 5426bf8 (5426bf86cd14955ed64c175a325655d9b0b3f691)

@rust-timer

This comment has been minimized.

@rust-timer

This comment has been minimized.

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 13, 2025
@cjgillot
Copy link
Contributor Author

@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 Jul 13, 2025
bors added a commit that referenced this pull request Jul 13, 2025
Also hash spans inside the same file as relative.

r? `@ghost` for perf
@bors
Copy link
Collaborator

bors commented Jul 13, 2025

⌛ Trying commit 0dddae1 with merge 9b70448...

@bors
Copy link
Collaborator

bors commented Jul 13, 2025

☀️ Try build successful - checks-actions
Build commit: 9b70448 (9b704482b8f77bc0b05b3cad1e80cb11fe41e40f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9b70448): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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.2% [0.2%, 0.3%] 29
Regressions ❌
(secondary)
0.3% [0.1%, 0.5%] 35
Improvements ✅
(primary)
-6.1% [-12.6%, -0.5%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.8% [-12.6%, 0.3%] 35

Max RSS (memory usage)

Results (primary 0.1%, secondary 4.1%)

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

mean range count
Regressions ❌
(primary)
1.8% [0.7%, 2.8%] 3
Regressions ❌
(secondary)
4.1% [4.1%, 4.1%] 1
Improvements ✅
(primary)
-1.7% [-1.7%, -1.6%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-1.7%, 2.8%] 6

Cycles

Results (primary -9.8%, secondary -3.9%)

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)
-9.8% [-10.6%, -9.3%] 3
Improvements ✅
(secondary)
-3.9% [-4.5%, -3.3%] 2
All ❌✅ (primary) -9.8% [-10.6%, -9.3%] 3

Binary size

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

Bootstrap: 465.532s -> 464.536s (-0.21%)
Artifact size: 374.73 MiB -> 374.69 MiB (-0.01%)

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

⌛ Trying commit 799e1d0 with merge bdb34d2

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Aug 3, 2025
Also hash spans inside the same file as relative.
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 3, 2025
@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

☀️ Try build successful (CI)
Build commit: bdb34d2 (bdb34d2c3aeba2b1d165de07937123e48da56e22, parent: f34ba774c78ea32b7c40598b8ad23e75cdac42a6)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bdb34d2): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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.2% [0.2%, 0.2%] 13
Regressions ❌
(secondary)
0.3% [0.1%, 0.5%] 29
Improvements ✅
(primary)
-6.3% [-12.9%, -0.5%] 6
Improvements ✅
(secondary)
-0.9% [-1.0%, -0.8%] 6
All ❌✅ (primary) -1.8% [-12.9%, 0.2%] 19

Max RSS (memory usage)

Results (primary -1.5%, 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)
4.7% [2.8%, 7.5%] 5
Improvements ✅
(primary)
-1.5% [-2.0%, -0.4%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.5% [-2.0%, -0.4%] 4

Cycles

Results (primary -6.8%, secondary -2.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)
-6.8% [-12.0%, -2.1%] 6
Improvements ✅
(secondary)
-2.2% [-2.3%, -2.1%] 2
All ❌✅ (primary) -6.8% [-12.0%, -2.1%] 6

Binary size

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

Bootstrap: 467.629s -> 467.604s (-0.01%)
Artifact size: 376.97 MiB -> 376.96 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 3, 2025
@compiler-errors
Copy link
Member

sorry i dont have the time to review this, perhaps petrochenkov has feelings about this? or re-roll

r? petrochenkov

@petrochenkov
Copy link
Contributor

I also have mixed feelings.
Could we perhaps land the general optimizations and refactorings from this PR first, and then reconsider the main functional change?
@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 Aug 14, 2025
@cjgillot cjgillot mentioned this pull request Aug 16, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 17, 2025
…chenkov

Simplify span caches

Split from rust-lang#143882

r? ``@petrochenkov``
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 18, 2025
…chenkov

Simplify span caches

Split from rust-lang#143882

r? ```@petrochenkov```
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 18, 2025
…chenkov

Simplify span caches

Split from rust-lang#143882

r? ````@petrochenkov````
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 18, 2025
…chenkov

Simplify span caches

Split from rust-lang#143882

r? `@petrochenkov`
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 18, 2025
…chenkov

Simplify span caches

Split from rust-lang#143882

r? ``@petrochenkov``
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Aug 19, 2025
…chenkov

Simplify span caches

Split from rust-lang#143882

r? `@petrochenkov`
rust-timer added a commit that referenced this pull request Aug 19, 2025
Rollup merge of #145505 - cjgillot:tweak-span-cache, r=petrochenkov

Simplify span caches

Split from #143882

r? `@petrochenkov`
@bors
Copy link
Collaborator

bors commented Aug 20, 2025

☔ The latest upstream changes (presumably #145600) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot cjgillot force-pushed the relative-span-file branch from 799e1d0 to 2efad95 Compare August 20, 2025 00:28
@rustbot
Copy link
Collaborator

rustbot commented Aug 20, 2025

This PR was rebased onto a different master 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.

@cjgillot cjgillot force-pushed the relative-span-file branch from 2efad95 to f9f3959 Compare August 20, 2025 00:29
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

9 participants