Skip to content

Commit f0c28cc

Browse files
ericjutacodex
andcommitted
build: add perf-build-local-fast recipe
Co-authored-by: Codex <noreply@openai.com>
1 parent 6972bd0 commit f0c28cc

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

justfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,24 @@ perf-build-local:
112112
fi
113113
./scripts/prune_perf_build_target.sh ./target/release/codex
114114

115+
# Build a machine-local codex binary with faster release rebuild settings for
116+
# local iteration. This writes the same `./target/release/codex` path as
117+
# `perf-build-local`, but trades some final optimization for faster compile/link.
118+
perf-build-local-fast:
119+
#!/usr/bin/env bash
120+
set -euo pipefail
121+
export CARGO_PROFILE_RELEASE_PANIC=abort
122+
export CARGO_PROFILE_RELEASE_LTO=thin
123+
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16
124+
EXTRA_FLAGS="${CODEX_PERF_EXTRA_FLAGS:-}"
125+
export RUSTFLAGS="${RUSTFLAGS:+$RUSTFLAGS }-C target-cpu=native${EXTRA_FLAGS:+ $EXTRA_FLAGS}"
126+
if [ -n "${CODEX_PERF_FEATURES:-}" ]; then
127+
cargo build -p codex-cli --release --locked --features "$CODEX_PERF_FEATURES"
128+
else
129+
cargo build -p codex-cli --release --locked
130+
fi
131+
./scripts/prune_perf_build_target.sh ./target/release/codex
132+
115133
# Build a machine-local codex binary using profile-guided optimization on top
116134
# of the same local tuning as `perf-build-local`.
117135
#

0 commit comments

Comments
 (0)