Skip to content

Avoid depending on forever-red DepNode when encoding metadata. #143247

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 2 commits into
base: master
Choose a base branch
from

Conversation

cjgillot
Copy link
Contributor

Split from #114669 for perf

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 Jun 30, 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 Jun 30, 2025
bors added a commit that referenced this pull request Jun 30, 2025
Avoid depending on forever-red DepNode when encoding metadata.

Split from #114669 for perf

r? `@petrochenkov`
@bors
Copy link
Collaborator

bors commented Jun 30, 2025

⌛ Trying commit 1584b0e with merge 22d2c51...

@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 30, 2025
@bors
Copy link
Collaborator

bors commented Jun 30, 2025

☀️ Try build successful - checks-actions
Build commit: 22d2c51 (22d2c5105e640237ee0a534b4a7d84635a5b4480)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (22d2c51): comparison URL.

Overall result: ❌ regressions - 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.7% [0.1%, 1.5%] 33
Regressions ❌
(secondary)
0.5% [0.2%, 1.1%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [0.1%, 1.5%] 33

Max RSS (memory usage)

Results (primary 2.0%, secondary 0.7%)

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

mean range count
Regressions ❌
(primary)
2.0% [0.6%, 7.0%] 7
Regressions ❌
(secondary)
0.7% [0.7%, 0.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.0% [0.6%, 7.0%] 7

Cycles

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

Binary size

Results (primary 0.4%, secondary 0.6%)

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.0%, 2.2%] 76
Regressions ❌
(secondary)
0.6% [0.0%, 3.3%] 36
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.0%, 2.2%] 76

Bootstrap: 694.099s -> 694.846s (0.11%)
Artifact size: 372.14 MiB -> 372.24 MiB (0.03%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 30, 2025
@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 Jul 1, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Jul 1, 2025

@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 1, 2025
bors added a commit that referenced this pull request Jul 1, 2025
Avoid depending on forever-red DepNode when encoding metadata.

Split from #114669 for perf

r? `@petrochenkov`
@bors
Copy link
Collaborator

bors commented Jul 1, 2025

⌛ Trying commit f12e837 with merge 3797379...

@bors
Copy link
Collaborator

bors commented Jul 1, 2025

☀️ Try build successful - checks-actions
Build commit: 3797379 (3797379f7091833992e5116135662ecd38c057d2)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3797379): 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.5% [0.1%, 2.1%] 84
Regressions ❌
(secondary)
1.2% [0.2%, 2.0%] 20
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-21.9% [-42.6%, -0.3%] 7
All ❌✅ (primary) 0.5% [0.1%, 2.1%] 84

Max RSS (memory usage)

Results (primary 0.4%, secondary -11.4%)

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

mean range count
Regressions ❌
(primary)
1.6% [1.0%, 2.3%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.4% [-3.4%, -3.4%] 1
Improvements ✅
(secondary)
-11.4% [-15.0%, -8.4%] 6
All ❌✅ (primary) 0.4% [-3.4%, 2.3%] 4

Cycles

Results (primary -1.1%, secondary -5.8%)

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

mean range count
Regressions ❌
(primary)
1.7% [1.1%, 2.7%] 5
Regressions ❌
(secondary)
3.3% [1.5%, 10.2%] 9
Improvements ✅
(primary)
-2.0% [-3.0%, -1.4%] 15
Improvements ✅
(secondary)
-17.5% [-37.9%, -2.1%] 7
All ❌✅ (primary) -1.1% [-3.0%, 2.7%] 20

Binary size

Results (primary 0.4%, secondary 0.6%)

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.0%, 2.2%] 76
Regressions ❌
(secondary)
0.6% [0.0%, 3.3%] 36
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.0%, 2.2%] 76

Bootstrap: 460.931s -> 461.575s (0.14%)
Artifact size: 372.21 MiB -> 372.24 MiB (0.01%)

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

This is actually a smaller regression than I was expecting.
And the cases in which the resolutions(()) stay green (I assume) give a huge speedup.

And this can likely be sped up further

  • by not hashing visibilities_for_hashing and maybe some other fields twice.
  • by un-querifying other cheap accesses to tables in ResolverGlobalCtxt

I think the doc_link_resolutions change can also be reverted now.

@cjgillot
Copy link
Contributor Author

cjgillot commented Jul 2, 2025

@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 2, 2025
bors added a commit that referenced this pull request Jul 2, 2025
Avoid depending on forever-red DepNode when encoding metadata.

Split from #114669 for perf

r? `@petrochenkov`
@bors
Copy link
Collaborator

bors commented Jul 2, 2025

⌛ Trying commit 992fa62 with merge a46eba4...

@bors
Copy link
Collaborator

bors commented Jul 2, 2025

☀️ Try build successful - checks-actions
Build commit: a46eba4 (a46eba429ac4af042b119d009c71fc20c27de559)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a46eba4): 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.5% [0.2%, 2.0%] 77
Regressions ❌
(secondary)
1.1% [0.2%, 2.1%] 22
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-25.5% [-42.6%, -16.4%] 6
All ❌✅ (primary) 0.5% [0.2%, 2.0%] 77

Max RSS (memory usage)

Results (primary -2.5%, secondary -6.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)
3.2% [2.9%, 3.6%] 2
Improvements ✅
(primary)
-2.5% [-2.8%, -2.2%] 2
Improvements ✅
(secondary)
-9.5% [-14.7%, -0.4%] 7
All ❌✅ (primary) -2.5% [-2.8%, -2.2%] 2

Cycles

Results (primary 2.1%, secondary -7.7%)

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

mean range count
Regressions ❌
(primary)
2.1% [1.3%, 4.1%] 9
Regressions ❌
(secondary)
2.3% [1.7%, 3.0%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-17.7% [-38.2%, -1.4%] 7
All ❌✅ (primary) 2.1% [1.3%, 4.1%] 9

Binary size

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

Bootstrap: 462.08s -> 461.207s (-0.19%)
Artifact size: 372.26 MiB -> 372.20 MiB (-0.02%)

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

cjgillot commented Jul 3, 2025

@petrochenkov this latest version only marks resolutions to be hashed. The perf has not terribly changed compared to the previous run. Cachegrind says the regression comes from hashing more spans and hashing many ModChildren. Do you want me to keep looking for perf improvements in this PR, or can it be done as follow-ups?

@petrochenkov
Copy link
Contributor

petrochenkov commented Jul 3, 2025

What is the difference between the previous version (#143247 (comment)) and the current one? I only see the doc_link_resolutions change.

I'm still interested in checking whether this

And this can likely be sped up further

  • by not hashing visibilities_for_hashing and maybe some other fields twice.
  • by un-querifying other cheap accesses to tables in ResolverGlobalCtxt

improved things, but the current results are good enough to merge and unblock #114669.

This investigation can be done in a follow up, just need to not forget about it.

@cjgillot
Copy link
Contributor Author

cjgillot commented Jul 3, 2025

What is the difference between the previous version (#143247 (comment)) and the current one? I only see the doc_link_resolutions change.

Yes, I only did that change. This makes the PR the minimal change for what #114669 needs.

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 3, 2025

📌 Commit 992fa62 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. 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.
5 participants