Skip to content

hygiene: Avoid recursion in syntax context decoding #139281

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 5, 2025

Conversation

petrochenkov
Copy link
Contributor

#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.

@rustbot
Copy link
Collaborator

rustbot commented Apr 2, 2025

r? @BoxyUwU

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

@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
@petrochenkov
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 Apr 2, 2025
@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label 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
Copy link
Collaborator

bors commented Apr 2, 2025

⌛ Trying commit fef3cf0 with merge 16553d2...

@BoxyUwU
Copy link
Member

BoxyUwU commented Apr 2, 2025

r? compiler

@rustbot rustbot assigned wesleywiser and unassigned BoxyUwU Apr 2, 2025
@bors
Copy link
Collaborator

bors commented Apr 2, 2025

☀️ Try build successful - checks-actions
Build commit: 16553d2 (16553d2192c698a649c1b626e2f82b499c9c5490)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (16553d2): comparison URL.

Overall result: ✅ improvements - 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 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
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
-0.4% [-0.8%, -0.2%] 12
Improvements ✅
(secondary)
-0.6% [-0.8%, -0.1%] 18
All ❌✅ (primary) -0.4% [-0.8%, -0.2%] 12

Max RSS (memory usage)

Results (primary -4.0%, secondary 0.0%)

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)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
2.7% [1.3%, 4.8%] 3
Improvements ✅
(primary)
-9.1% [-9.1%, -9.1%] 1
Improvements ✅
(secondary)
-4.0% [-5.8%, -2.1%] 2
All ❌✅ (primary) -4.0% [-9.1%, 1.1%] 2

Cycles

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

Binary size

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

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.1% [-0.4%, -0.0%] 77
Improvements ✅
(secondary)
-0.2% [-0.6%, -0.0%] 34
All ❌✅ (primary) -0.1% [-0.4%, -0.0%] 77

Bootstrap: 776.833s -> 776.783s (-0.01%)
Artifact size: 365.93 MiB -> 365.92 MiB (-0.00%)

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

Nice, this part is a pure win.
@rustbot ready

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 3, 2025
@wesleywiser
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 4, 2025

📌 Commit fef3cf0 has been approved by wesleywiser

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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 4, 2025
@bors
Copy link
Collaborator

bors commented Apr 5, 2025

⌛ Testing commit fef3cf0 with merge da83217...

@bors
Copy link
Collaborator

bors commented Apr 5, 2025

☀️ Test successful - checks-actions
Approved by: wesleywiser
Pushing da83217 to master...

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

github-actions bot commented Apr 5, 2025

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 1e008dd (parent) -> da83217 (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: 5253.8s -> 6834.3s (30.1%)
  2. dist-armv7-linux: 5214.9s -> 5397.9s (3.5%)
  3. dist-i686-msvc: 6746.1s -> 6980.2s (3.5%)
  4. test-various: 4198.9s -> 4323.5s (3.0%)
  5. dist-various-1: 4358.8s -> 4473.4s (2.6%)
  6. dist-powerpc64-linux: 5336.6s -> 5472.8s (2.6%)
  7. armhf-gnu: 4430.4s -> 4542.0s (2.5%)
  8. dist-apple-various: 6249.1s -> 6394.3s (2.3%)
  9. dist-arm-linux: 5380.3s -> 5503.2s (2.3%)
  10. x86_64-msvc-ext3: 7351.5s -> 7513.9s (2.2%)
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 (da83217): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-0.7%, -0.4%] 3
Improvements ✅
(secondary)
-0.6% [-0.7%, -0.3%] 14
All ❌✅ (primary) -0.5% [-0.7%, -0.4%] 3

Max RSS (memory usage)

Results (secondary 1.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)
3.6% [2.6%, 5.4%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.3%, -1.7%] 2
All ❌✅ (primary) - - 0

Cycles

Results (primary 3.3%, secondary -6.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)
3.3% [3.3%, 3.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.5% [-8.8%, -2.1%] 3
All ❌✅ (primary) 3.3% [3.3%, 3.3%] 1

Binary size

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

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.1% [-0.4%, -0.0%] 78
Improvements ✅
(secondary)
-0.2% [-0.6%, -0.0%] 34
All ❌✅ (primary) -0.1% [-0.4%, -0.0%] 78

Bootstrap: 777.007s -> 778.037s (0.13%)
Artifact size: 365.98 MiB -> 365.98 MiB (-0.00%)

petrochenkov added a commit to petrochenkov/rust that referenced this pull request Apr 26, 2025
They are no longer necessary after rust-lang#139281
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