Files
pnpm/.github/workflows
Zoltan Kochan 69cfcb7417 perf(ci): cache benchmark binaries per commit instead of rebuilding (#12173)
The integrated-benchmark "Precompile benchmark revisions" step took ~14
minutes every run. Two causes:

1. The "Cache Rust builds" step cached the multi-GB
   `bench-work-env/*/pacquet/target` dirs under a 1-minute restore
   timeout. A restore that large never finished in 60s, so (with
   `continue-on-error`) the cache silently missed and every run built all
   four targets cold.
2. `pacquet@HEAD` and `pnpr@HEAD` resolve to the same commit but built in
   separate clones, compiling the `pacquet` binary twice (same for main).

Cache the compiled binaries per *resolved commit* instead:

- Orchestrator: a `--reuse-prebuilt-binaries` flag skips the clone +
  `cargo build` for a target whose output binary is already present (i.e.
  restored from cache). Targets are built pnpr-first; since a `pnpr@<rev>`
  build also produces the `pacquet` client binary, a same-revision
  `pacquet@<rev>` reuses it by copy rather than recompiling the commit.
- Workflow: resolve the HEAD/main SHAs, then cache the two `pnpr@<rev>`
  binaries keyed on the commit (they cover all four targets via the
  dedup-copy). `main` is a near-certain hit on PRs (stable SHA) and a
  same-HEAD re-run hits HEAD too, so only a fresh HEAD compiles. Drop the
  giant `bench-work-env/*/pacquet/target` cache (the small binary caches
  restore in seconds, with no eviction risk) and keep a cargo-deps +
  orchestrator-target cache with a realistic 3-minute timeout.

A fresh-HEAD run now compiles one workspace once (~half the old work);
re-runs and main reuse cached binaries and skip compilation entirely.
2026-06-03 17:26:49 +02:00
..
2026-06-02 12:06:18 +02:00