mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
The workspace has no `[profile.release]`, so the shipped napi binary (`index.node`) is built on stock cargo defaults with the symbol table retained: 11.2MB on arm64 macOS. Fat LTO + `codegen-units = 1` + `strip = true` lands at 7.2MB with no runtime cost. Release builds get slower; debug builds (`snap --rust`, the e2e harness) are unaffected. `profile-rust-port.ts --release` overrides `strip` so profiling runs keep symbol names. Measured (arm64 macOS, `cargo build --release -p react_compiler_napi`): | profile | size | |---|---| | defaults | 11.2MB | | this PR | 7.2MB | `opt-level = "s"` was measured and rejected: it cuts a further 2MB but costs ~50% compile throughput (3.9s to 5.85s median compiling 598 fixtures through the release CLI).