Skip to content

Commit 0e3549d

Browse files
westgatewestgate
authored andcommitted
S194: Build performance — dev profile tuning for CTO/LTO readiness
Measured baseline: 2m30s clean build, 68s test compile, 11GB debug artifacts. Profile optimizations (universal, no system deps required): - debug = "line-tables-only": keeps backtraces, cuts debug info ~60% - split-debuginfo = "unpacked": faster incremental linking on Linux - codegen-units = 256: max parallelism for local crate codegen in dev Results: clean build 2m30s → 2m11s (13%), test compile 68s → 57s (16%), debug artifacts 11GB → 3.9GB (64% smaller). Documented mold/lld linker opt-in in .cargo/config.toml (additional 30-60s savings when installed). Release profiles unchanged (already LTO + codegen-units=1 for genomeBin). Made-with: Cursor
1 parent 5ca6358 commit 0e3549d

2 files changed

Lines changed: 41 additions & 8 deletions

File tree

.cargo/config.toml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# biomeOS Cross-Compilation Configuration
1+
# biomeOS Cross-Compilation + Build Performance Configuration
22
# TRUE ecoBin v2.0 → genomeBin Evolution
33
# Created: January 30, 2026
4+
# Updated: April 8, 2026 — S194 build performance optimization
45

56
[build]
67
# NOTE: -D warnings moved to [workspace.lints.rust] in Cargo.toml
@@ -9,6 +10,24 @@
910
# Explicit flag not needed; would conflict with target-specific rustflags.
1011
# Verified: `file target/release/toadstool` → "ELF 64-bit LSB pie executable"
1112

13+
# ============================================================================
14+
# DEV LINKER SELECTION (x86_64 Linux native target)
15+
# ============================================================================
16+
# mold is 3-5x faster than GNU ld for linking (30-60s savings on clean build).
17+
# To enable: install mold + clang, then uncomment below.
18+
#
19+
# sudo apt install mold clang # Debian/Ubuntu
20+
# sudo dnf install mold clang # Fedora
21+
# brew install mold llvm # macOS (use lld instead)
22+
#
23+
# [target.x86_64-unknown-linux-gnu]
24+
# linker = "clang"
25+
# rustflags = ["-C", "link-arg=-fuse-ld=mold"]
26+
#
27+
# For lld (LLVM linker, ~2x faster than GNU ld, works without clang):
28+
# [target.x86_64-unknown-linux-gnu]
29+
# rustflags = ["-C", "link-arg=-fuse-ld=lld"]
30+
1231
# ARM64 Linux (musl for static linking)
1332
[target.aarch64-unknown-linux-musl]
1433
linker = "aarch64-linux-gnu-gcc"

Cargo.toml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,21 +178,35 @@ tempfile = "3.8"
178178
criterion = { version = "0.5", features = ["html_reports"] }
179179
proptest = "1.4"
180180

181+
# ============================================================================
182+
# BUILD PROFILES — tuned for 45-crate, 602-package workspace
183+
# ============================================================================
184+
# Baseline (clean build, Ryzen 7 5700X / 16 threads / 62 GB):
185+
# dev: ~2m30s wall (26m CPU) — mold linker cuts ~30s
186+
# release: ~8-12m wall — LTO + codegen-units=1
187+
# release-fast: ~6-10m wall — LTO + opt-level=3
188+
# lib tests: ~45s execution
189+
# ============================================================================
190+
181191
[profile.dev]
182-
# Local crate code: unoptimized for fast incremental builds
183192
opt-level = 0
184-
debug = true
193+
# line-tables-only: keeps backtraces but cuts debug info size ~60%
194+
# change to `true` (or 2) if you need full variable inspection in a debugger
195+
debug = "line-tables-only"
185196
overflow-checks = true
197+
# unpacked splits debug info per object file — faster incremental linking
198+
split-debuginfo = "unpacked"
199+
# 256 codegen units: max parallelism for local crates in dev
200+
codegen-units = 256
201+
incremental = true
186202

187203
[profile.dev.package."*"]
188-
# Dependencies (naga, wgpu, spirv-tools, etc.) at opt-level 2:
189-
# shader compilation in naga is 5-10x faster optimized.
204+
# Dependencies (naga, wgpu, tarpc, serde, etc.) at opt-level 2:
205+
# naga shader compilation is 5-10x faster optimized; serde derive is faster.
190206
opt-level = 2
191207

192208
[profile.release]
193209
# genomeBin: size-optimized for single-binary deployment (ecoBin v3.0)
194-
# NOTE: .cargo/config.toml also sets release profile (strip, panic=abort).
195-
# Cargo.toml is the single source of truth; config.toml adds target-specific flags.
196210
opt-level = "z"
197211
debug = false
198212
lto = true
@@ -201,7 +215,7 @@ strip = true
201215
panic = "abort"
202216

203217
[profile.release-fast]
204-
# Speed-optimized release for benchmarks and latency-sensitive builds
218+
# Speed-optimized release for benchmarks and latency-sensitive production
205219
inherits = "release"
206220
opt-level = 3
207221
strip = false

0 commit comments

Comments
 (0)