Skip to content

don't store opaque info during encoding #139241

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

Merged
merged 1 commit into from
Apr 14, 2025
Merged

Conversation

bvanjoi
Copy link
Contributor

@bvanjoi bvanjoi commented Apr 2, 2025

Now remapped_ctxts reserved and let's check the performance.

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 Apr 2, 2025
@lqd
Copy link
Member

lqd commented Apr 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 Apr 2, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 2, 2025
don't store opaque info during encoding

Now `remapped_ctxts` reserved and let's check the performance.

r? `@petrochenkov`
@bors
Copy link
Collaborator

bors commented Apr 2, 2025

⌛ Trying commit 941e1ef with merge 5fe2fa1...

@bors
Copy link
Collaborator

bors commented Apr 2, 2025

☀️ Try build successful - checks-actions
Build commit: 5fe2fa1 (5fe2fa19dccbc7033df9d47ca2be3c9c658e1fb5)

@rust-timer

This comment has been minimized.

@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 2, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5fe2fa1): comparison URL.

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

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
0.9% [0.3%, 1.1%] 5
Regressions ❌
(secondary)
0.4% [0.2%, 0.9%] 12
Improvements ✅
(primary)
-0.3% [-0.5%, -0.2%] 13
Improvements ✅
(secondary)
-0.4% [-0.5%, -0.1%] 16
All ❌✅ (primary) 0.0% [-0.5%, 1.1%] 18

Max RSS (memory usage)

Results (primary 0.2%, secondary 2.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.4% [2.4%, 2.4%] 1
Regressions ❌
(secondary)
2.4% [1.9%, 2.8%] 2
Improvements ✅
(primary)
-1.9% [-1.9%, -1.9%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-1.9%, 2.4%] 2

Cycles

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

Binary size

Results (primary -0.2%, secondary -0.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.9%, -0.0%] 121
Improvements ✅
(secondary)
-0.4% [-0.9%, -0.1%] 37
All ❌✅ (primary) -0.2% [-0.9%, -0.0%] 121

Bootstrap: 775.08s -> 774.329s (-0.10%)
Artifact size: 365.94 MiB -> 365.94 MiB (-0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Apr 2, 2025
@petrochenkov
Copy link
Contributor

Instruction results are mixed, but it's a clear improvement in binary sizes.
I want to try one more thing before merging this.

@petrochenkov petrochenkov added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 2, 2025
@petrochenkov
Copy link
Contributor

Blocked on #139281.
@rustbot blocked

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 2, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 2, 2025
hygiene: Avoid recursion in syntax context decoding

rust-lang#139241 has two components
- Avoiding recursion during syntax context decoding
- Encoding/decoding only the non-redundant data, and recalculating the redundant data again during decoding

Both of these parts may influence compilation times, possibly in opposite directions.
So this PR contains only the first part to evaluate its effect in isolation.
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 5, 2025
hygiene: Avoid recursion in syntax context decoding

rust-lang#139241 has two components
- Avoiding recursion during syntax context decoding
- Encoding/decoding only the non-redundant data, and recalculating the redundant data again during decoding

Both of these parts may influence compilation times, possibly in opposite directions.
So this PR contains only the first part to evaluate its effect in isolation.
@petrochenkov
Copy link
Contributor

#139281 has landed.
@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-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Apr 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 5, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@bvanjoi
Copy link
Contributor Author

bvanjoi commented Apr 12, 2025

I have a few questions here:

  1. Does this imply we should close the current PR?
  2. If we stick with storing only SyntaxContextKey in the disk cache, we’d simply be changing SyntaxContextDataNonRecursive to SyntaxContextKey — which would essentially leave things as they are now.

@petrochenkov
Copy link
Contributor

Does this imply we should close the current PR?

I think we should at least measure the effect (incl. binary size).

we’d simply be changing SyntaxContextDataNonRecursive to SyntaxContextKey — which would essentially leave things as they are now.

In the first case we encode more and decode more, in the second case we encode less, decode less but re-calculate more. Not exactly the same.

@petrochenkov
Copy link
Contributor

@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 Apr 12, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 12, 2025
don't store opaque info during encoding

Now `remapped_ctxts` reserved and let's check the performance.

r? `@petrochenkov`
@bors
Copy link
Collaborator

bors commented Apr 12, 2025

⌛ Trying commit 8ae6485 with merge e3fff58...

@bors
Copy link
Collaborator

bors commented Apr 12, 2025

☀️ Try build successful - checks-actions
Build commit: e3fff58 (e3fff58fa34c73361d7bda6ee094298a7421f243)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e3fff58): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary -0.8%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.3% [3.3%, 3.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.9% [-3.4%, -2.4%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.8% [-3.4%, 3.3%] 3

Cycles

Results (secondary 3.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Binary size

Results (primary -0.2%, secondary -0.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.5%, -0.0%] 92
Improvements ✅
(secondary)
-0.3% [-0.7%, -0.0%] 37
All ❌✅ (primary) -0.2% [-0.5%, -0.0%] 92

Bootstrap: 776.898s -> 777.128s (0.03%)
Artifact size: 365.51 MiB -> 365.49 MiB (-0.01%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Apr 12, 2025
@petrochenkov
Copy link
Contributor

Let's land this, it's a clear code simplification and binary size improvement, and the perf changes are within the noise level.
@bors r+

@bors
Copy link
Collaborator

bors commented Apr 13, 2025

📌 Commit 8ae6485 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 Apr 13, 2025
@bors
Copy link
Collaborator

bors commented Apr 14, 2025

⌛ Testing commit 8ae6485 with merge c580c49...

@bors
Copy link
Collaborator

bors commented Apr 14, 2025

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing c580c49 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 14, 2025
@bors bors merged commit c580c49 into rust-lang:master Apr 14, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 14, 2025
Copy link

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 5961e5b (parent) -> c580c49 (this PR)

Test differences

Show 8 test diffs

Additionally, 8 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Job duration changes

  1. x86_64-apple-2: 5044.6s -> 6506.7s (29.0%)
  2. dist-x86_64-apple: 10770.2s -> 7945.5s (-26.2%)
  3. x86_64-apple-1: 7102.8s -> 8751.6s (23.2%)
  4. x86_64-gnu-debug: 6486.8s -> 6140.2s (-5.3%)
  5. dist-x86_64-msvc: 6203.4s -> 5954.5s (-4.0%)
  6. dist-apple-various: 6877.8s -> 6608.8s (-3.9%)
  7. aarch64-gnu-debug: 4279.9s -> 4112.6s (-3.9%)
  8. i686-msvc-1: 9750.2s -> 9391.9s (-3.7%)
  9. dist-aarch64-apple: 4717.2s -> 4890.0s (3.7%)
  10. dist-powerpc-linux: 5454.1s -> 5265.6s (-3.5%)
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 (c580c49): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary 0.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.5%, 0.6%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.5%, 0.6%] 5

Cycles

Results (primary 2.1%, secondary -0.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Binary size

Results (primary -0.2%, secondary -0.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.5%, -0.0%] 92
Improvements ✅
(secondary)
-0.3% [-0.7%, -0.0%] 37
All ❌✅ (primary) -0.2% [-0.5%, -0.0%] 92

Bootstrap: 784.641s -> 784.038s (-0.08%)
Artifact size: 365.11 MiB -> 365.12 MiB (0.00%)

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 14, 2025
…r=marcoieni

Improve wording of post-merge report

Slight changes to improve the rendered output e.g. [here](rust-lang#139241 (comment)) if only doctest changes were found.

r? `@marcoieni`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 14, 2025
Rollup merge of rust-lang#139807 - Kobzol:post-merge-report-wording, r=marcoieni

Improve wording of post-merge report

Slight changes to improve the rendered output e.g. [here](rust-lang#139241 (comment)) if only doctest changes were found.

r? `@marcoieni`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 27, 2025
…errors

rustc_span: Some hygiene cleanups

Mostly enabled by rust-lang#139241 and rust-lang#139281.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 27, 2025
Rollup merge of rust-lang#140346 - petrochenkov:cleanhyg, r=compiler-errors

rustc_span: Some hygiene cleanups

Mostly enabled by rust-lang#139241 and rust-lang#139281.
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. 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.

6 participants