chore: disable incremental compilation and trim debug info for dev builds - #581
Open
vsbuffalo wants to merge 1 commit into
Open
chore: disable incremental compilation and trim debug info for dev builds#581vsbuffalo wants to merge 1 commit into
vsbuffalo wants to merge 1 commit into
Conversation
vsbuffalo
force-pushed
the
chore/dev-profile-incremental-off
branch
from
August 12, 2026 17:50
cc42261 to
32a9130
Compare
…ilds
Cargo's dev defaults (incremental = true, debug = 2) are a good trade in
the normal regime: more files on disk for faster edit-compile cycles.
This workspace crossed a scale threshold where that stops holding on
macOS.
`target/debug` had reached 88 GB across ~1.67M files — 44 GB of
`incremental/` and 44 GB of `deps/` — against a 4.1 GB `target/release`.
Every Mach-O artifact in there is assessed by `syspolicyd` (Gatekeeper),
which sat at ~70% of one core and had accumulated 192 hours of CPU over
26 days of uptime. A debug `cargo test` took 6m52s at 4% CPU: not
compute-bound, but waiting on filesystem and security-assessment work
generated by the tree itself.
Deleting `target/debug` is what recovers the build time; this commit is
what stops it coming back. Measured cold on identical source, after that
deletion:
stock dev this profile
wall 27.2s 21.2s
CPU work 176s 126s
target/debug 2.5 GB 1.1 GB
files 18,647 3,181
incremental cache 1.1 GB 0 B
The file count is the load-bearing number, since that is what is
assessed. 5.9x fewer artifacts per build, and no incremental cache to
accumulate — 1.1 GB of it regenerated from a single cold build, which is
the rate that produced 44 GB over 26 days of continuous agent builds.
`line-tables-only` for workspace crates and no debug info for
dependencies is Cargo's own build-performance recommendation: panic
backtraces still resolve to source locations without paying for full
DWARF. A `debugging` profile inheriting from dev keeps `debug = 2`
available for the rare case that wants a real debugger, rather than
making every CI and agent build carry metadata it does not use.
`split-debuginfo` is deliberately NOT changed. macOS defaults dev builds
to `unpacked`, `packed` runs `dsymutil` on every build, and with debug
info cut this far there is little left to pack. It wants its own
benchmark before anyone touches it.
This encodes the fix in the repo rather than relying on everyone
remembering CARGO_INCREMENTAL=0.
vsbuffalo
force-pushed
the
chore/dev-profile-incremental-off
branch
from
August 13, 2026 22:23
32a9130 to
1efd04c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cargo's dev defaults (incremental = true, debug = 2) are a good trade in
the normal regime: more files on disk for faster edit-compile cycles.
This workspace crossed a scale threshold where that stops holding on
macOS.
target/debughad reached 88 GB across ~1.67M files — 44 GB ofincremental/and 44 GB ofdeps/— against a 4.1 GBtarget/release.Every Mach-O artifact in there is assessed by
syspolicyd(Gatekeeper),which sat at ~70% of one core and had accumulated 192 hours of CPU over
26 days of uptime. A debug
cargo testtook 6m52s at 4% CPU: notcompute-bound, but waiting on filesystem and security-assessment work
generated by the tree itself.
Deleting
target/debugis what recovers the build time; this commit iswhat stops it coming back. Measured cold on identical source, after that
deletion:
The file count is the load-bearing number, since that is what is
assessed. 5.9x fewer artifacts per build, and no incremental cache to
accumulate — 1.1 GB of it regenerated from a single cold build, which is
the rate that produced 44 GB over 26 days of continuous agent builds.
line-tables-onlyfor workspace crates and no debug info fordependencies is Cargo's own build-performance recommendation: panic
backtraces still resolve to source locations without paying for full
DWARF. A
debuggingprofile inheriting from dev keepsdebug = 2available for the rare case that wants a real debugger, rather than
making every CI and agent build carry metadata it does not use.
split-debuginfois deliberately NOT changed. macOS defaults dev buildsto
unpacked,packedrunsdsymutilon every build, and with debuginfo cut this far there is little left to pack. It wants its own
benchmark before anyone touches it.
This encodes the fix in the repo rather than relying on everyone
remembering CARGO_INCREMENTAL=0.