Add image re-encoding benchmarks.

This is one of the more compute-heavy workflows that the
app server performs, we should be able measure how fast it is
against past revisions.

Add a step to the general CI job which will run each benchmark
as a test without trying to actually measure many iterations.
This commit is contained in:
Adam Perry
2026-05-20 15:21:48 -07:00
parent 58be470d15
commit 4792e463c4
8 changed files with 238 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/../codex-rs"
bench_targets="$(
cargo metadata --no-deps --format-version 1 \
| jq -r '.packages[] as $package | $package.targets[] | select(any(.kind[]; . == "bench")) | [$package.name, .name] | @tsv'
)"
if [[ -n "$bench_targets" ]]; then
while IFS=$'\t' read -r package bench_target; do
cargo bench -p "$package" --bench "$bench_target" -- --test
done <<< "$bench_targets"
fi