perf(docker): drop the useless CGO dep-prewarm line#656
Merged
Conversation
The prewarm added in #654 was premised on a multi-minute CGO compile of duckdb-go. That premise was wrong: duckdb-go-bindings ships PREBUILT static libs (libduckdb_*.a etc, ~1.7GB in the module cache) — there is no DuckDB C++ compile to cache. The other prewarmed dep, pg_query_go, cold-compiles in ~4s. So the prewarm layer saved single-digit seconds while adding a confusing extra build step. Measured on warm main builds after #654: main 288s -> 264s controlplane 241s -> 229s The ~10% saving came from the LAYER REORDERING (module + extension downloads moved ahead of COPY . ., so they cache on source-only PRs), not from the prewarm. The dominant remaining cost is the final CGO *link* of the prebuilt static libs (~68s), which caching can't touch because it changes with every first-party source edit. Remove the prewarm RUN from all three Dockerfiles. Keep the valuable reordering and the worker pin-without-tidy fix from #655. Net build-time wins still live here: - module download + extension fetch cached before COPY . . Real PR-latency lever (separate change): build only linux/arm64 in PR CI (mw-dev is arm64), halving the worker matrix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The CGO dep-prewarm added in #654 was premised on a multi-minute CGO
compile of duckdb-go. That premise was wrong:
duckdb-go-bindingsships prebuilt static libs (
libduckdb_*.a,libparquet_extension.a… ~1.7GB in the module cache) — there is no DuckDB C++ compile to cache.
The other prewarmed dep,
pg_query_go, cold-compiles in ~4s. So theprewarm layer saved single-digit seconds while adding a confusing extra
step.
Measured on warm main builds after #654:
That ~10% came from the layer reordering (module + extension
downloads moved ahead of
COPY . ., so they cache on source-only PRs),not from the prewarm. The dominant remaining cost is the final CGO
link of the prebuilt static libs (~68s in the warm build's
#18),which caching can't touch — it changes with every source edit.
What
Remove the prewarm
RUNfrom all three Dockerfiles. Keep:Real lever (separate PR)
Build only
linux/arm64in PR CI (mw-dev is 29 arm64 / 2 amd64),halving the worker matrix — that targets the link floor the prewarm
couldn't.
🤖 Generated with Claude Code