perf(build): use line-tables-only debug info in the dev profile - #24339
Merged
Conversation
`dev` is the profile behind every `cargo build` and `cargo test`, so its debug
info is generated over and over. `line-tables-only` keeps file and line numbers
-- panics and `RUST_BACKTRACE` output stay just as useful -- and drops the
variable-level DWARF that only an interactive debugger consumes.
Measured per crate, interleaved with the baseline so machine drift cancels out.
The flag is passed to the crate under test only, so cached dependency artifacts
stay valid and nothing else moves:
crate debug=2 line-tables-only
datafusion-physical-plan 8.89s 7.43s
datafusion-functions-aggregate 5.86s 4.63s
datafusion-physical-expr 4.57s 3.59s
datafusion-functions 4.64s 4.04s
datafusion-expr 4.54s 3.57s
datafusion-functions-nested 4.37s 3.06s
datafusion-optimizer 3.91s 3.12s
datafusion-common 3.73s 3.10s
datafusion-sql 3.57s 2.43s
datafusion-datasource-parquet 3.27s 2.44s
datafusion-datasource 1.90s 1.42s
datafusion-physical-optimizer 1.22s 0.99s
-------------------------------------------------------
sum 50.5s 39.8s (-21%)
The saving is codegen-side, as expected: `datafusion-catalog`, which spends its
time in the trait solver rather than in LLVM, moves only 7.4s -> 7.0s.
Artifacts shrink too -- `libdatafusion_physical_plan.rlib` goes from 141MB to
100MB.
Verified that backtraces keep their file and line numbers under the new setting:
thread 'main' panicked at datafusion/core/src/bin/print_functions_docs.rs:38:9
at ./datafusion/core/src/bin/print_functions_docs.rs:38:9
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
dev profiledev profile
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24339 +/- ##
=======================================
Coverage 81.14% 81.14%
=======================================
Files 1112 1112
Lines 386933 386933
Branches 386933 386933
=======================================
+ Hits 313967 313976 +9
+ Misses 54476 54463 -13
- Partials 18490 18494 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
comphead
approved these changes
Aug 13, 2026
comphead
left a comment
Contributor
There was a problem hiding this comment.
Thanks @Dandandan makes sense for local builds.
Contributor
|
🚀 |
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.
Which issue does this PR close?
Adresses: #13814
Found while profiling compile times for #24325 / #24326 / #24329 / #24330,
which removed the trait-solving cost from the four crates on the critical path
and left LLVM as the dominant remaining cost.
Rationale for this change
devis the profile behind everycargo buildandcargo test, so its debuginfo is generated over and over.
debug = "line-tables-only"keeps file and linenumbers — panics and
RUST_BACKTRACEoutput stay just as useful — and drops thevariable-level DWARF that only an interactive debugger consumes.
Measured per crate, interleaved with the baseline so machine drift cancels
out. The flag is passed to the crate under test only, so cached dependency
artifacts stay valid and nothing else moves between the two measurements:
debug = 2line-tables-onlydatafusion-physical-plandatafusion-functions-aggregatedatafusion-physical-exprdatafusion-functionsdatafusion-exprdatafusion-functions-nesteddatafusion-optimizerdatafusion-commondatafusion-sqldatafusion-datasource-parquetdatafusion-datasourcedatafusion-physical-optimizerThe saving is codegen-side, as you would expect:
datafusion-catalog, whichspends its time in the trait solver rather than in LLVM, moves only 7.4s → 7.0s.
Artifacts shrink as well —
libdatafusion_physical_plan.rlibgoes from 141MBto 100MB.
What changes are included in this PR?
One setting on
[profile.dev], plus an update to the profile documentation blockabove it, which currently advertises "full debug info" for
dev.Are these changes tested?
Are there any user-facing changes?
For anyone stepping through DataFusion in a debugger, local variable inspection
needs
CARGO_PROFILE_DEV_DEBUG=2 cargo build(or a local override in.cargo/config.toml); the comment inCargo.tomlsays so. Everything else —panic locations, backtraces,
#[test]failures — is unchanged.🤖 Generated with Claude Code