Repository navigation
perf(compile)!: Switch dev profile to debug=lines-and-tables-only - #17518
Conversation
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Starting as a draft because I had originally talked about a gap before doing this for transition purposes. At #15931 (comment) I said
#17215 changes things a bit in that people just need to set Even then in #17215, I said
Don't remember why I was still feeling we needed a gap. Could be good to get parts of this in stable to start wider conversations and awareness. |
b50b802 to
d414a2c
Compare
| [RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..] -C debuginfo=2 [..]` | ||
| [RUNNING] `rustc --crate-name foo --edition=2015 src/main.rs [..]--crate-type bin --emit=[..]link[..] -C debuginfo=2 [..]` | ||
| [RUNNING] `rustc --crate-name t1 --edition=2015 tests/t1.rs [..]--emit=[..]link[..] -C debuginfo=2 [..]` | ||
| [RUNNING] `rustc --crate-name foo --edition=2015 src/lib.rs [..]--crate-type lib --emit=[..]link[..] -C debuginfo=line-tables-only [..]` |
There was a problem hiding this comment.
Should we just omit debuginfo value part, in case we change that in the future?
(though unlikely)
|
We had an fcp for the direction but not specific changes |
|
I guess we probably need a benchmark report for why the chosen value. The currently discussions are scattered and not sure which is the final one. (like I remembered Josh proposed opt-level=1 but then say no it didn't help) |
With rust-lang#17215 merged, users can set the new `debug` profile as their default build profile without an MSRV bump and get the same behavior between previous versions of Cargo and those that include this change. There is still the possibility of `opt-level` but that is less certain. For cargo `cargo test --no-run` build+target dir: - master: 3.6G - this PR: 2.9G For bevy `cargo test --no-run` build+target dir: - master: 369G - this PR: 348G Surprised at how much space was taken up: - `build/`: 189G -> 174G - `examples/`: 175G -> 168G (across 364 examples) - `incremental/`: 14G -> 8G Fixes rust-lang#15931
abfabcd to
9fb8531
Compare
|
I've included two examples for disk space savings. https://internals.rust-lang.org/t/feedback-request-performance-improvements-from-reducing-debug-info/21825/9 has a lot of self-reports on build time impact, both full build and incremental. |
948b695 to
5a8a258
Compare
5a8a258 to
030ea68
Compare
|
I was looking at debuginfo stripping in host deps and realized that we haven't changed this. I forgot what the blockers were. Given (It might be too late to get into 1.102 but that is fine) |
|
I'm fine with starting it now. I had wanted to wait but can't remember the reason, see also #17518 (comment) |
|
Here is a benchmark report for some chosen porjects pulling from across #15931, the internals thread. Summary:
expand to see LLM collected data analysis
DiskFresh
Build timeOn 96-core Linux devbox against 6238f6f:
Community reports from the internals thread:
|
|
Looks like snapshot need to be blessed again (and rebase onto master) |
030ea68 to
db67a0f
Compare
This comment has been minimized.
This comment has been minimized.
db67a0f to
2f3a5dd
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Update cargo submodule 22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20 2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000 - fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742) - Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735) - fix(config)!: Polish the API (rust-lang/cargo#17736) - chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723) - perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518) - test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737) - Reworked output mtime tracking (rust-lang/cargo#17732) - fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556) - reference: remove implied meaning (rust-lang/cargo#17731) - chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722) - chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724) - chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725) - feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714) - chore(deps): update msrv to v1.100 (rust-lang/cargo#17721) - chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726) - chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720) - chore: fix CI errors due to 1.100 (rust-lang/cargo#17719) - Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718) - refactor: Misc cleanup while playing with config (rust-lang/cargo#17713) - feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710) - chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712) - feat(config): Add a generated schema file (rust-lang/cargo#17708)
### What does this PR try to resolve? Edits we missed in rust-lang/cargo#17518 ### Notes to reviewers --- 🤖 LLM involvement: Found by them. Written by me.
Update cargo submodule 22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20 2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000 - fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742) - Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735) - fix(config)!: Polish the API (rust-lang/cargo#17736) - chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723) - perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518) - test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737) - Reworked output mtime tracking (rust-lang/cargo#17732) - fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556) - reference: remove implied meaning (rust-lang/cargo#17731) - chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722) - chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724) - chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725) - feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714) - chore(deps): update msrv to v1.100 (rust-lang/cargo#17721) - chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726) - chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720) - chore: fix CI errors due to 1.100 (rust-lang/cargo#17719) - Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718) - refactor: Misc cleanup while playing with config (rust-lang/cargo#17713) - feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710) - chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712) - feat(config): Add a generated schema file (rust-lang/cargo#17708)
Every WASIX test built from a Rust fixture failed on the Linux lanes:
cargo-wasix could not read the build messages of cargo ("invalid type:
string \"line-tables-only\", expected u32"). Since rust-lang/cargo#17518
the dev profile defaults to `debug = "line-tables-only"`, which cargo
reports by name, and the WASIX toolchain, which has no cargo of its own,
falls back to the `nightly` one that CI installs. `main` passed only
because its last run got an older nightly.
The fixtures are now built with `CARGO_PROFILE_DEV_DEBUG=true`, which
cargo reports as a number, as it reported the old default.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Update cargo submodule 22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20 2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000 - fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742) - Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735) - fix(config)!: Polish the API (rust-lang/cargo#17736) - chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723) - perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518) - test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737) - Reworked output mtime tracking (rust-lang/cargo#17732) - fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556) - reference: remove implied meaning (rust-lang/cargo#17731) - chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722) - chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724) - chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725) - feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714) - chore(deps): update msrv to v1.100 (rust-lang/cargo#17721) - chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726) - chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720) - chore: fix CI errors due to 1.100 (rust-lang/cargo#17719) - Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718) - refactor: Misc cleanup while playing with config (rust-lang/cargo#17713) - feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710) - chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712) - feat(config): Add a generated schema file (rust-lang/cargo#17708)
Update cargo submodule 22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20 2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000 - fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742) - Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735) - fix(config)!: Polish the API (rust-lang/cargo#17736) - chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723) - perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518) - test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737) - Reworked output mtime tracking (rust-lang/cargo#17732) - fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556) - reference: remove implied meaning (rust-lang/cargo#17731) - chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722) - chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724) - chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725) - feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714) - chore(deps): update msrv to v1.100 (rust-lang/cargo#17721) - chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726) - chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720) - chore: fix CI errors due to 1.100 (rust-lang/cargo#17719) - Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718) - refactor: Misc cleanup while playing with config (rust-lang/cargo#17713) - feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710) - chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712) - feat(config): Add a generated schema file (rust-lang/cargo#17708)
|
Hi, I know it's a bit late to comment on this. I'm not 100% sure the procedure here, but imho I think this is a bad default that should be reverted. We've already received a bug report about it and it took me a bisect to end up here. tl;dr, I do not think this concern was given appropriate weight:
And the existence of a workaround solution isn't good enough. It's a change to fundamental default behavior and there doesn't seem to be any user-facing indication that something has changed/how the user can get full debug info. This is doubly true w.r.t. debuggers, since they will happily let you try to debug them, but provide ~no useful information at all. In my experience, people are not familiar enough with debuggers to see that debugger output as anything other than a debugger and/or compiler bug. For the past X years (X being at least 4 or 5, basing purely off my own experience), One of the delights I had that made me stick to Rust after bouncing off of c++ was a combination of
Breaking either of those seems serious enough to be a last resort, let alone both of them. I don't think "minimizing the size of my non-release builds" is something so important that it is "more default" than "my non-release build is debuggable". Even if size is really important, the unfortunate truth is that Rust itself has been saying the latter is the default long enough that it will have certainly shifted a not-insignificant portion of the user-base's perception of what is "default" to include debuggability. The debugging experience is already generally known to be bad. How likely is it that someone has heard that offhand, has little-to-no experience with debugging Rust, and just assumes that the debugging experience with Users with experience have already been on the rollercoaster of the debugger (i.e. visualizer scripts, which most people don't even know exist) sometimes not working at all, sometimes working decently. To those users, will the debugger not working come across as a rust configuration issue that they can fix? Very likely not. Is there any plan on how to notify people of this change beyond hoping they'll read the release notes? |
|
@Walnut356 would you mind submitting a new issue? People may miss discussions in a closed PR. |
Update cargo submodule 22 commits in ede6cefea9731cb595942338824c2f9a610b8189..f93c676e3e7ab1aee08dc95d869700f6b99a1a20 2026-11-11 12:33:16 +0000 to 2026-11-15 17:27:10 +0000 - fix(config)!: Clean up ConfigRelativePath (rust-lang/cargo#17742) - Add support for `annotate-snippets`'s `no-graphics` output format (rust-lang/cargo#17735) - fix(config)!: Polish the API (rust-lang/cargo#17736) - chore(deps): update rust crate rusqlite to 0.42.0 (rust-lang/cargo#17723) - perf(compile)!: Switch dev profile to debug=lines-and-tables-only (rust-lang/cargo#17518) - test: Add unordered to pub_priv::verify_mix_cargo_feature_z (rust-lang/cargo#17737) - Reworked output mtime tracking (rust-lang/cargo#17732) - fix(trim-paths): sanitize absolute source paths in fingerprint (rust-lang/cargo#17556) - reference: remove implied meaning (rust-lang/cargo#17731) - chore(deps): update rust crate opener to 0.9.0 (rust-lang/cargo#17722) - chore(deps): update taiki-e/install-action action to v2.90.3 (rust-lang/cargo#17724) - chore(deps): update actions/checkout action to v7 (rust-lang/cargo#17725) - feat(config): Iterate on config.toml's schema (rust-lang/cargo#17714) - chore(deps): update msrv to v1.100 (rust-lang/cargo#17721) - chore(deps): update actions/upload-artifact action to v7 (rust-lang/cargo#17726) - chore(deps): update crate-ci/typos action to v1.52.1 (rust-lang/cargo#17720) - chore: fix CI errors due to 1.100 (rust-lang/cargo#17719) - Unified invoked.timestamp location for compilation and build script units (rust-lang/cargo#17718) - refactor: Misc cleanup while playing with config (rust-lang/cargo#17713) - feat: OSC 8 link for package name in cargo info (rust-lang/cargo#17710) - chore: Update annotate-snippets to 0.12.18 (rust-lang/cargo#17712) - feat(config): Add a generated schema file (rust-lang/cargo#17708)
Implement runs spend about 12 of their 33 minutes compiling: of 47 runs on Nov 19-22, a filtered test run took 30 seconds at the median, of which 1.4 ran tests. The dev profile now keeps line tables alone for our code and no debug info for dependencies, as Cargo's build-performance guide recommends and uv, ruff and biome do. Cargo makes line tables the dev default in 1.102 (rust-lang/cargo#17518), after which the first setting can go. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What does this PR try to resolve?
With #17215 merged, users can set the new
debugprofile as their default build profile without an MSRV bump and get the same behavior between previous versions of Cargo and those that include this change.For cargo
cargo test --no-runbuild+target dir:For bevy
cargo test --no-runbuild+target dir:Surprised at how much space was taken up:
build/: 189G -> 174Gexamples/: 175G -> 168G (across 364 examples)incremental/: 14G -> 8GFor various reports on the impact on build times for this profile setting, see https://internals.rust-lang.org/t/feedback-request-performance-improvements-from-reducing-debug-info/21825/9
Fixes #15931
How to test and review this PR?
There is still the possibility of
opt-levelbut that is less certain.