diff --git a/Cargo.toml b/Cargo.toml index 7556a93..2e6c3bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,21 @@ web-sys = { version = "0.3", features = ["Gpu", "Navigator", "Window", "Document wasm-bindgen = "0.2" js-sys = "0.3" +# Desktop release tuning. This renderer is GPU-bound, but Bevy's CPU path +# (resource management, system scheduling, egui, wgpu command submission) +# still benefits measurably from cross-crate LTO and a single codegen unit: +# - lto = "fat": cross-crate inlining, removes trampolines through Bevy/wgpu. +# - codegen-units = 1: best optimization, at the cost of slower compiles. +# - panic = "abort": smaller binary, no unwind tables in the hot path. +# - strip: drop debug symbols from the shipped binary. +# `wasm-release` inherits release, so web picks these up too (then overrides +# opt-level to "z" for binary size). +[profile.release] +lto = "fat" +codegen-units = 1 +panic = "abort" +strip = "symbols" + # Smaller wasm binary in release web builds (per Bevy examples README). [profile.wasm-release] inherits = "release"