diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f377397..2aa3301a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,6 +56,16 @@ Tests that require a real LLM key will skip gracefully if the env var is absent. cargo build --workspace ``` +### Fast Release Build (for development) + +The default `--release` profile uses full LTO and single-codegen-unit, which produces the smallest/fastest binary but is slow to compile. For iterating locally, use the `release-fast` profile instead: + +```bash +cargo build --profile release-fast -p openfang-cli +``` + +This cuts link time significantly (thin LTO, 8 codegen units, `opt-level=2`) while still producing a binary fast enough to run integration tests against. Use `--release` only for final binaries or CI. + ### Run All Tests ```bash diff --git a/Cargo.toml b/Cargo.toml index fb67a8eb..b08de6c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -150,3 +150,10 @@ lto = true codegen-units = 1 strip = true opt-level = 3 + +[profile.release-fast] +inherits = "release" +lto = "thin" +codegen-units = 8 +opt-level = 2 +strip = false