Skip to content

perf(build): set dev profile to line-tables-only debug info#515

Merged
CSRessel merged 1 commit into
mainfrom
perf/dev-debug-line-tables
Jun 13, 2026
Merged

perf(build): set dev profile to line-tables-only debug info#515
CSRessel merged 1 commit into
mainfrom
perf/dev-debug-line-tables

Conversation

@nori-sessions

@nori-sessions nori-sessions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Sets profile.dev.debug = "line-tables-only" in nori-rs/Cargo.toml. This keeps file:line info in backtraces while dropping the full DWARF that makes the final link of the nori binary memory-bound on low-RAM machines.

Why

While benchmarking clean nori builds across cargo/rustc/linker configurations, the dominant cost was not the linker choice (mold/lld/bfd are all within run-to-run noise). It was the debug-info footprint.

On a RAM-constrained machine (no swap, target/ on overlayfs), the default debuginfo=2 makes the final link mmap huge DWARF inputs across ~600 crates. Under memory pressure the kernel evicts and re-reads those pages from disk, so the linker sits in disk-sleep reading tens of GB. A clean default-profile debug build never completed in 35+ min.

Measured clean build of the nori bin by debug-info level (same machine, mold):

debug setting clean build notes
debuginfo=2 (default) did not complete (>35 min) link thrash, ~70 GB of reads
"line-tables-only" ~9 min no thrash, keeps backtrace line numbers
0 (none) ~5 min no thrash, no line numbers

"line-tables-only" is the sweet spot: it removes the thrash while preserving the file:line data that makes panic backtraces useful during development.

Scope

  • Only profile.dev is affected. profile.release, profile.test, and profile.ci-test are unchanged.
  • debug = "line-tables-only" is the explicit string form — note debug = 1 maps to "limited", which is a different (larger) level.

Test plan

  • cargo metadata --no-deps parses the manifest cleanly
  • cargo build on a dev machine still produces usable backtraces with file:line

The dev profile uses cargo's default `debug = 2` (full DWARF). Linking the
`nori` binary then has to mmap the full debug info of ~600 crates; on
memory-constrained machines (and CI/cloud VMs with little RAM and no swap)
the kernel evicts and re-reads those pages, sending the linker into disk
thrash. A clean debug build was observed reading tens of GB at the final
link and failing to complete in 35+ minutes.

`debug = "line-tables-only"` keeps file:line in panics and backtraces while
dropping the bulk of the DWARF, which removes the thrash: clean build ~9 min,
incremental relink ~30s on the same constrained box. Scoped to profile.dev,
so test/ci-test profiles are unaffected.
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
@CSRessel CSRessel merged commit 8272579 into main Jun 13, 2026
2 checks passed
@CSRessel CSRessel deleted the perf/dev-debug-line-tables branch June 13, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant