Garbage-collect old incremental compilation sessions - #162240
Conversation
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
d7c7cb1 to
62352f9
Compare
62352f9 to
bc21abb
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
… r=<try> Garbage-collect old incremental compilation sessions
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (0cc728b): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 7.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -2.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 477.112s -> 477.159s (0.01%) |
|
It’s the previous behavior isn’t intended, so this fix would make sense. What do you think @bjorn3? |
This comment was marked as resolved.
This comment was marked as resolved.
|
@bors r+ |
|
r? bjorn3 |
…session-gc, r=bjorn3 Garbage-collect old incremental compilation sessions ## Summary rustc cleans up old incremental-cache snapshots twice during a compilation: once at startup (after loading the previous cache), and then again after finishing and finalizing the new cache. In rust-lang#147821, we started skipping the current session during cleanup. But that means we're also skipping cleanup _after_ the session has finished, so we're keeping _both_ the previous and the completed snapshot on disk. (The snapshots don't accumulate indefinitely -- the "extra" snapshot gets removed when the next compilation starts, but that compilation then leaves another snapshot behind when it finishes.) This PR modifies the logic to skip the current session while it is still active, but remove it once finalized. Testing it locally for [Ruff](https://github.com/astral-sh/ruff) and [uv](https://github.com/astral-sh/uv), the target directory shrinks significantly... The query caches are almost exactly 50% smaller, and `target` as a whole is 27.3% smaller in Ruff and 31.1% smaller in uv.
…uwer Rollup of 11 pull requests Successful merges: - #162752 (`rust-analyzer` subtree update) - #161868 (libtest: never iterate over all tests in `--exact` mode) - #161903 (Fix initialization cycle in `target_config`) - #162240 (Garbage-collect old incremental compilation sessions) - #161675 (document that t-lang does not need involvement for unobservable intrisics) - #162630 (Simplify the `G` in `Diag<'a, G>`) - #162647 (Add regression test for previous overflow evaluating the requirement) - #162703 (regression test for valtree leaf const) - #162723 (Add regression test for unexpected type for constructor) - #162735 (Remove pointless `A: Allocator` bounds in boxed.rs) - #162736 (clean up trivial region constraint filtering)
…session-gc, r=bjorn3 Garbage-collect old incremental compilation sessions ## Summary rustc cleans up old incremental-cache snapshots twice during a compilation: once at startup (after loading the previous cache), and then again after finishing and finalizing the new cache. In rust-lang#147821, we started skipping the current session during cleanup. But that means we're also skipping cleanup _after_ the session has finished, so we're keeping _both_ the previous and the completed snapshot on disk. (The snapshots don't accumulate indefinitely -- the "extra" snapshot gets removed when the next compilation starts, but that compilation then leaves another snapshot behind when it finishes.) This PR modifies the logic to skip the current session while it is still active, but remove it once finalized. Testing it locally for [Ruff](https://github.com/astral-sh/ruff) and [uv](https://github.com/astral-sh/uv), the target directory shrinks significantly... The query caches are almost exactly 50% smaller, and `target` as a whole is 27.3% smaller in Ruff and 31.1% smaller in uv.
…uwer Rollup of 15 pull requests Successful merges: - #162752 (`rust-analyzer` subtree update) - #161903 (Fix initialization cycle in `target_config`) - #162240 (Garbage-collect old incremental compilation sessions) - #162610 (fix tailcall indirect return) - #162634 (Implement semantic analysis for named `Fn` trait params) - #161675 (document that t-lang does not need involvement for unobservable intrisics) - #162160 (turn aligned-in-packed error into lint) - #162504 (Stabilize `unsafe_cell_access`) - #162516 (tidy: Sort multi-line types by treating `>` as a closing bracket) - #162630 (Simplify the `G` in `Diag<'a, G>`) - #162647 (Add regression test for previous overflow evaluating the requirement) - #162703 (regression test for valtree leaf const) - #162723 (Add regression test for unexpected type for constructor) - #162735 (Remove pointless `A: Allocator` bounds in boxed.rs) - #162736 (clean up trivial region constraint filtering)
…uwer Rollup of 16 pull requests Successful merges: - #162762 (Subtree sync for rustc_codegen_cranelift) - #162752 (`rust-analyzer` subtree update) - #161903 (Fix initialization cycle in `target_config`) - #162240 (Garbage-collect old incremental compilation sessions) - #162610 (fix tailcall indirect return) - #162634 (Implement semantic analysis for named `Fn` trait params) - #161675 (document that t-lang does not need involvement for unobservable intrisics) - #162160 (turn aligned-in-packed error into lint) - #162504 (Stabilize `unsafe_cell_access`) - #162516 (tidy: Sort multi-line types by treating `>` as a closing bracket) - #162630 (Simplify the `G` in `Diag<'a, G>`) - #162647 (Add regression test for previous overflow evaluating the requirement) - #162703 (regression test for valtree leaf const) - #162723 (Add regression test for unexpected type for constructor) - #162735 (Remove pointless `A: Allocator` bounds in boxed.rs) - #162736 (clean up trivial region constraint filtering)
Rollup merge of #162240 - charliermarsh:charlie/incremental-session-gc, r=bjorn3 Garbage-collect old incremental compilation sessions ## Summary rustc cleans up old incremental-cache snapshots twice during a compilation: once at startup (after loading the previous cache), and then again after finishing and finalizing the new cache. In #147821, we started skipping the current session during cleanup. But that means we're also skipping cleanup _after_ the session has finished, so we're keeping _both_ the previous and the completed snapshot on disk. (The snapshots don't accumulate indefinitely -- the "extra" snapshot gets removed when the next compilation starts, but that compilation then leaves another snapshot behind when it finishes.) This PR modifies the logic to skip the current session while it is still active, but remove it once finalized. Testing it locally for [Ruff](https://github.com/astral-sh/ruff) and [uv](https://github.com/astral-sh/uv), the target directory shrinks significantly... The query caches are almost exactly 50% smaller, and `target` as a whole is 27.3% smaller in Ruff and 31.1% smaller in uv.
…uwer Rollup of 16 pull requests Successful merges: - rust-lang/rust#162762 (Subtree sync for rustc_codegen_cranelift) - rust-lang/rust#162752 (`rust-analyzer` subtree update) - rust-lang/rust#161903 (Fix initialization cycle in `target_config`) - rust-lang/rust#162240 (Garbage-collect old incremental compilation sessions) - rust-lang/rust#162610 (fix tailcall indirect return) - rust-lang/rust#162634 (Implement semantic analysis for named `Fn` trait params) - rust-lang/rust#161675 (document that t-lang does not need involvement for unobservable intrisics) - rust-lang/rust#162160 (turn aligned-in-packed error into lint) - rust-lang/rust#162504 (Stabilize `unsafe_cell_access`) - rust-lang/rust#162516 (tidy: Sort multi-line types by treating `>` as a closing bracket) - rust-lang/rust#162630 (Simplify the `G` in `Diag<'a, G>`) - rust-lang/rust#162647 (Add regression test for previous overflow evaluating the requirement) - rust-lang/rust#162703 (regression test for valtree leaf const) - rust-lang/rust#162723 (Add regression test for unexpected type for constructor) - rust-lang/rust#162735 (Remove pointless `A: Allocator` bounds in boxed.rs) - rust-lang/rust#162736 (clean up trivial region constraint filtering)
…uwer Rollup of 16 pull requests Successful merges: - rust-lang/rust#162762 (Subtree sync for rustc_codegen_cranelift) - rust-lang/rust#162752 (`rust-analyzer` subtree update) - rust-lang/rust#161903 (Fix initialization cycle in `target_config`) - rust-lang/rust#162240 (Garbage-collect old incremental compilation sessions) - rust-lang/rust#162610 (fix tailcall indirect return) - rust-lang/rust#162634 (Implement semantic analysis for named `Fn` trait params) - rust-lang/rust#161675 (document that t-lang does not need involvement for unobservable intrisics) - rust-lang/rust#162160 (turn aligned-in-packed error into lint) - rust-lang/rust#162504 (Stabilize `unsafe_cell_access`) - rust-lang/rust#162516 (tidy: Sort multi-line types by treating `>` as a closing bracket) - rust-lang/rust#162630 (Simplify the `G` in `Diag<'a, G>`) - rust-lang/rust#162647 (Add regression test for previous overflow evaluating the requirement) - rust-lang/rust#162703 (regression test for valtree leaf const) - rust-lang/rust#162723 (Add regression test for unexpected type for constructor) - rust-lang/rust#162735 (Remove pointless `A: Allocator` bounds in boxed.rs) - rust-lang/rust#162736 (clean up trivial region constraint filtering)
…uwer Rollup of 16 pull requests Successful merges: - rust-lang/rust#162762 (Subtree sync for rustc_codegen_cranelift) - rust-lang/rust#162752 (`rust-analyzer` subtree update) - rust-lang/rust#161903 (Fix initialization cycle in `target_config`) - rust-lang/rust#162240 (Garbage-collect old incremental compilation sessions) - rust-lang/rust#162610 (fix tailcall indirect return) - rust-lang/rust#162634 (Implement semantic analysis for named `Fn` trait params) - rust-lang/rust#161675 (document that t-lang does not need involvement for unobservable intrisics) - rust-lang/rust#162160 (turn aligned-in-packed error into lint) - rust-lang/rust#162504 (Stabilize `unsafe_cell_access`) - rust-lang/rust#162516 (tidy: Sort multi-line types by treating `>` as a closing bracket) - rust-lang/rust#162630 (Simplify the `G` in `Diag<'a, G>`) - rust-lang/rust#162647 (Add regression test for previous overflow evaluating the requirement) - rust-lang/rust#162703 (regression test for valtree leaf const) - rust-lang/rust#162723 (Add regression test for unexpected type for constructor) - rust-lang/rust#162735 (Remove pointless `A: Allocator` bounds in boxed.rs) - rust-lang/rust#162736 (clean up trivial region constraint filtering)
View all comments
Summary
rustc cleans up old incremental-cache snapshots twice during a compilation: once at startup (after loading the previous cache), and then again after finishing and finalizing the new cache.
In #147821, we started skipping the current session during cleanup. But that means we're also skipping cleanup after the session has finished, so we're keeping both the previous and the completed snapshot on disk. (The snapshots don't accumulate indefinitely -- the "extra" snapshot gets removed when the next compilation starts, but that compilation then leaves another snapshot behind when it finishes.)
This PR modifies the logic to skip the current session while it is still active, but remove it once finalized.
Testing it locally for Ruff and uv, the target directory shrinks significantly... The query caches are almost exactly 50% smaller, and
targetas a whole is 27.3% smaller in Ruff and 31.1% smaller in uv.