mirror of
https://github.com/hanzoai/react.git
synced 2026-10-30 14:46:25 +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).
17 lines
447 B
TOML
17 lines
447 B
TOML
[workspace]
|
|
members = [
|
|
"crates/*",
|
|
"packages/babel-plugin-react-compiler-rust/native",
|
|
]
|
|
resolver = "3"
|
|
|
|
# Sizes the shipped napi binary (index.node). Measured on arm64 macOS:
|
|
# default release is 11.2MB; fat LTO + one codegen unit + stripping symbols
|
|
# lands at 7.2MB with no runtime cost. Release builds get slower; debug
|
|
# builds (snap --rust, the e2e harness) are unaffected.
|
|
[profile.release]
|
|
lto = "fat"
|
|
codegen-units = 1
|
|
strip = true
|
|
|