Skip to content

Stop caching typeck on disk #111099

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

Closed

Conversation

Noratrieb
Copy link
Member

I would naively assume that if the inputs to typeck are unchanged, the inputs of the dependendents of typeck would also stay unchanged, making the caching redundant.

I have no data to back this up, so let's try getting some.

#111026 got some nice wins from caching less typeck, let's see what happens here. Perf results are not enough data to determine whether this is good, but it's a starting point.

r? @ghost

I would naively assume that if the inputs to typeck are unchanged, the
inputs of the dependendents of typeck would also stay unchanged, making
the caching redundant.

I have no data to back this up, so let's try getting some.
@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 May 2, 2023
@Noratrieb
Copy link
Member 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 May 2, 2023
@bors
Copy link
Collaborator

bors commented May 2, 2023

⌛ Trying commit eebe0fe with merge 800b4489e24a641f03354624f76693d1190e4d1d...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-14 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- [incremental] tests/incremental/change_private_fn/struct_point.rs stdout ----

error in revision `cfail2`: test compilation failed although it shouldn't!
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/incremental/change_private_fn/struct_point.rs" "-Zthreads=1" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--cfg" "cfail2" "-C" "incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/change_private_fn/struct_point/struct_point.inc" "-Z" "incremental-verify-ich" "-O" "--error-format" "json" "--json" "future-incompat" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/change_private_fn/struct_point" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/incremental/change_private_fn/struct_point/auxiliary" "-Z" "query-dep-graph"
stdout: none
--- stderr -------------------------------
--- stderr -------------------------------
error: `typeck(fn_calls_methods_in_same_impl::check)` should have been loaded from disk but it was not
   |
LL |     pub fn check() {
   |     ^^^^^^^^^^^^^^

@bors
Copy link
Collaborator

bors commented May 2, 2023

☀️ Try build successful - checks-actions
Build commit: 800b4489e24a641f03354624f76693d1190e4d1d (800b4489e24a641f03354624f76693d1190e4d1d)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (800b4489e24a641f03354624f76693d1190e4d1d): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

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 a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
32.1% [1.2%, 166.1%] 98
Regressions ❌
(secondary)
61.3% [0.2%, 454.7%] 30
Improvements ✅
(primary)
-2.4% [-5.3%, -0.4%] 20
Improvements ✅
(secondary)
-3.0% [-7.9%, -0.2%] 37
All ❌✅ (primary) 26.2% [-5.3%, 166.1%] 118

Max RSS (memory usage)

Results

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)
10.5% [1.8%, 28.6%] 96
Regressions ❌
(secondary)
11.6% [2.1%, 35.0%] 22
Improvements ✅
(primary)
-2.6% [-4.8%, -1.4%] 6
Improvements ✅
(secondary)
-4.4% [-5.7%, -1.8%] 13
All ❌✅ (primary) 9.8% [-4.8%, 28.6%] 102

Cycles

Results

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)
38.8% [1.0%, 140.7%] 99
Regressions ❌
(secondary)
71.6% [2.6%, 478.3%] 28
Improvements ✅
(primary)
-2.9% [-5.8%, -1.2%] 10
Improvements ✅
(secondary)
-4.0% [-6.3%, -2.7%] 16
All ❌✅ (primary) 35.0% [-5.8%, 140.7%] 109

Binary size

Results

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.1% [0.0%, 0.2%] 19
Regressions ❌
(secondary)
0.1% [0.1%, 0.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.2%] 19

Bootstrap: 656.873s -> 653.777s (-0.47%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 3, 2023
@Noratrieb
Copy link
Member Author

The test failure shows why this is bad. We have non incremental passes (😢) that use typeck.

@Noratrieb Noratrieb closed this May 3, 2023
@Noratrieb Noratrieb deleted the no-typeck-for-you-query-cache branch May 3, 2023 09:08
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-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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants