Skip to content

perf(component-build): save cache mounts only when lockfiles change - #403

Merged
JesperTerkelsen merged 1 commit into
mainfrom
perf/cache-mounts-lockfile-key
Nov 15, 2026
Merged

JesperTerkelsen merged 1 commit into
mainfrom
perf/cache-mounts-lockfile-key

Conversation

@JesperTerkelsen

@JesperTerkelsen JesperTerkelsen commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

🏭 Factory Context
Session: Open in Factory
Requested by: @JesperTerkelsen

Intent

Since #402, every S3-cached ARC image build extracts and uploads its Dockerfile cache mounts, which costs more than the faster compile it buys. This goes back to saving them only when the lockfiles change, and keeps the cache folder outside the checkout.

Decisions: give up the fresh compile cache inside Docker
  • Root cause: cache-dance skips extraction only on an exact key hit, and the per-commit key never hits, so every build paid the extract and upload.
  • The compile-speed gain is better had by compiling on the runner (infra-portal does that in its own PR); the in-Docker cache stays for dependencies, which only change with lockfiles.
Verified: per-commit key made infra-portal's build job ~1 min slower than no cache
  • Second deploy after #402: go build 6.8 s (was ~130 s), but restore + inject 67 s and extract + upload 135 s; build job 4m16s.
  • First deploy after #402, with no cache restored at all: build and push 146 s and no restore cost; the extra cost was only the save.
  • actionlint passes.

Gaps

Thermo-nuclear review: no findings

Review of 17a268b

No findings.

@JesperTerkelsen
JesperTerkelsen marked this pull request as ready for review November 15, 2026 06:21
@JesperTerkelsen
JesperTerkelsen requested a review from a team as a code owner November 15, 2026 06:21
@JesperTerkelsen
JesperTerkelsen requested review from prasad-manu and removed request for a team November 15, 2026 06:21
@JesperTerkelsen
JesperTerkelsen merged commit 3783b7a into main Nov 15, 2026
1 check passed
@JesperTerkelsen
JesperTerkelsen deleted the perf/cache-mounts-lockfile-key branch November 15, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants