Skip to content

perf(compile)!: Switch dev profile to debug=lines-and-tables-only - #17518

Draft
epage wants to merge 1 commit into
rust-lang:masterfrom
epage:dev-debug-split
Draft

epage wants to merge 1 commit into
rust-lang:masterfrom
epage:dev-debug-split

Conversation

@epage

@epage epage commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR try to resolve?

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

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

For 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-level but that is less certain.

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation A-profiles Area: profiles S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 26, 2026
@rustbot

rustbot commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

r? @weihanglo

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Muscraft, @epage, @weihanglo
  • @Muscraft, @epage, @weihanglo expanded to Muscraft, epage, weihanglo
  • Random selection from Muscraft, weihanglo

@epage
epage marked this pull request as draft September 26, 2026 02:20
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 26, 2026
@epage

epage commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Starting as a draft because I had originally talked about a gap before doing this for transition purposes.

At #15931 (comment) I said

After sufficient time for debug to percolate out so people can migrate, change dev profile's settings

#17215 changes things a bit in that people just need to set build.profile = "debug" independent of their MSRV, and they will get the old behavior.

Even then in #17215, I said

dev profile changes are deferred for 1+ releases

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.

@weihanglo weihanglo left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot if we have done FCP already. If not we should.

View changes since this review

Comment thread tests/testsuite/build.rs
[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 [..]`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just omit debuginfo value part, in case we change that in the future?

(though unlikely)

@epage

epage commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

We had an fcp for the direction but not specific changes

@weihanglo

Copy link
Copy Markdown
Member

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
@epage

epage commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

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.

@epage
epage force-pushed the dev-debug-split branch 2 times, most recently from a52a817 to e5f7b22 Compare October 21, 2026 00:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-documenting-cargo-itself Area: Cargo's documentation A-profiles Area: profiles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debugger support in dev profile slows down builds

3 participants