From 3ba52ee608a15d024542be81f342bec9aadd09b6 Mon Sep 17 00:00:00 2001 From: chairmanpow Date: Sat, 3 Oct 2026 17:41:41 +0100 Subject: [PATCH] build: line tables only and unpacked debuginfo, so the dev tree stops filling the disk DWARF is ~97% of what rustc writes here: the largest `benilla-app` codegen unit measured 145 MB, of which 61 MB was `.debug_str` and 13 MB `.debug_info` against 1.5 MB of `.text`. That carried a 1.5 GB `libbenilla_app` rlib, a 2.9 GB test binary and an 82 GB `target/debug`. `.debug_line` survives, so a backtrace and `gdb bt` still name a file and a line; `split-debuginfo` leaves the rest in the object files rather than copying it into the linked binary. --- Cargo.toml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d747a754..d67d18cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,15 +44,28 @@ lua-src = { path = "third_party/lua-src" } kira = { path = "third_party/kira" } # Dependencies at opt-level 3 in dev: at opt-level 0, avian/parry collision drops a run to <1 fps. +# Line tables only, and never packed into the binary, for the reason under `[profile.dev]` below. [profile.dev.package."*"] opt-level = 3 +debug = "line-tables-only" +split-debuginfo = "unpacked" # Our crates at opt-level 1: Bevy's generic hot paths monomorphize into them, and at opt-level 0 # Stormwind drops from a pinned 60 fps to ~45; the warm incremental rebuild cost is ~0. [profile.dev] opt-level = 1 - -# No debuginfo trimming: `debug = "line-tables-only"` measures no recurring win on macOS + sccache. +# Line tables only, not `debug = 2`. DWARF is ~97% of what rustc writes for this tree: the largest +# benilla-app codegen unit measured 145 MB, of which 61 MB was `.debug_str` and 13 MB +# `.debug_info` against 1.5 MB of `.text`. Carrying that cost a 1.5 GB `libbenilla_app` rlib, a +# 2.9 GB test binary and an 82 GB `target/debug`, which filled the disk on a 1 TB volume and made +# every write slower for it. `.debug_line` survives, so a panic backtrace and `gdb`'s `bt` still +# name a file and a line; `split-debuginfo` leaves the rest in the object files rather than copying +# it into the linked binary, which is what the link step paid for. +# +# This supersedes "no debuginfo trimming measures no recurring win", which was measured on macOS +# with sccache and no disk pressure. Re-measure on macOS before assuming it holds there. +debug = "line-tables-only" +split-debuginfo = "unpacked" # The shipping build (`--profile ship`): fat LTO measures -1.0 cpu_ms (-5 %) against `release`, # which stays the measured profile because fat LTO's link time would tax every iteration.