Skip to content

Commit 6972bd0

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

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
@@ -177,6 +177,24 @@ perf-build-m3:
177177
fi
178178
./scripts/prune_perf_build_target.sh ./target/release/codex
179179

180+
# Build an Apple M3-tuned codex binary with faster release rebuild settings for
181+
# local iteration. This writes the same `./target/release/codex` path as
182+
# `perf-build-m3`, but trades some final optimization for faster compile/link.
183+
perf-build-m3-fast:
184+
#!/usr/bin/env bash
185+
set -euo pipefail
186+
export CARGO_PROFILE_RELEASE_PANIC=abort
187+
export CARGO_PROFILE_RELEASE_LTO=thin
188+
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16
189+
EXTRA_FLAGS="${CODEX_PERF_EXTRA_FLAGS:-}"
190+
export RUSTFLAGS="${RUSTFLAGS:+$RUSTFLAGS }-C target-cpu=apple-m3${EXTRA_FLAGS:+ $EXTRA_FLAGS}"
191+
if [ -n "${CODEX_PERF_FEATURES:-}" ]; then
192+
cargo build -p codex-cli --release --locked --features "$CODEX_PERF_FEATURES"
193+
else
194+
cargo build -p codex-cli --release --locked
195+
fi
196+
./scripts/prune_perf_build_target.sh ./target/release/codex
197+
180198
# Build an Apple M3-tuned codex binary using profile-guided optimization.
181199
perf-build-m3-pgo:
182200
#!/usr/bin/env bash

0 commit comments

Comments
 (0)