Repository navigation
Reduce debug information for local dependencies #769
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -292,10 +292,30 @@ why CI caches `target` keyed on the lockfile and links with mold, and it is why | |
| a local run that suddenly takes twenty minutes has usually just had its cache | ||
| invalidated rather than got slower. | ||
|
|
||
| Trimming debug info, which is what buys CI 40% per relink, was measured here | ||
| and buys nothing: 7.5s against 8.1s on macOS, where the system linker rather | ||
| than mold does the work. It stays a CI setting for that reason. | ||
| CI uses `CARGO_PROFILE_DEV_DEBUG` and `CARGO_PROFILE_TEST_DEBUG` to keep | ||
| only line tables across the entire dev and test profiles. After a | ||
| one-file edit, relinking the test suite took 16.6s with full debug | ||
| information and 9.9s with line tables only, about 40% less time. The | ||
| macOS comparison with the system linker measured 7.5s and 8.1s. The | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This drops which configuration took 7.5s and which took 8.1s. It also drops the conclusion the old text drew: on macOS, where the system linker rather than mold does the link, trimming debug info buys no relink time. That conclusion is why disk space is the only argument left for the local setting, so name each time with its configuration and state the conclusion in one sentence, instead of leaving two bare numbers between the CI figure and the disk figures.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you confirm which macOS relink time used full debug information and which used line-tables-only? The earlier documentation lists 7.5s and 8.1s without labeling the configurations. I’ll label both timings and clarify that the local override is intended to save disk space. |
||
| reason to use line tables in local builds is to save disk space. | ||
|
|
||
| Local dev and test builds use `debug = "line-tables-only"` in their | ||
| `package."*"` overrides. Dependencies retain file and line information | ||
| for backtraces, and workspace packages keep full debug information. In | ||
|
jianjian0504 marked this conversation as resolved.
Resolved
|
||
| the Linux measurement from issue #755, a clean | ||
| `cargo test --no-run --all-targets` used 8.0 GB with line tables only, | ||
| down from 9.9 GB with full debug information. Its `web` test executable | ||
| shrank from 404 MB to 270 MB. On Apple Silicon, a clean build of the | ||
| `web` test alone used 49.3 MiB (1.06%) less target directory space. | ||
|
|
||
| Line tables retain source file and line information for backtraces, but | ||
| debuggers lack type and local variable information when stepping into | ||
| dependencies. To restore full debug information for Tokio in the test | ||
| profile, run: | ||
|
|
||
| ```sh | ||
| cargo test --config 'profile.test.package.tokio.debug=2' | ||
| ``` | ||
| ## Environment check | ||
|
|
||
| `scripts/env-check.sh` is the one place that says what a run needs. It only | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.