Repository navigation
perf(ci): optimize DuckDB test execution and eliminate redundant builds - #1066
Merged
Merged
Conversation
athvin
force-pushed
the
perf/backend-ci-profile
branch
from
November 9, 2026 22:05
71f01a1 to
71cb224
Compare
This was referenced Nov 9, 2026
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.
Closes #1065
What
Optimize bundled DuckDB for dev/tests and execute extension checks from the already-built integration binary. Add an opt-in comparison of the standard free x86-64 and ARM64 GitHub runners.
Why
Full backend CI took 8m11–8m33. Its slowest tests executed an unoptimized database engine; the separate extension invocation also rebuilt a different Cargo feature graph for about 65 seconds.
Proof
make check,make check-e2e, the real selected-package/extension runner, 46 CI helper tests, skills drift checks, workflow-shell checks and actionlint passed locally before pushing. The same 52 lake tests passed in 343.506 → 76.350 seconds locally. The first complete hosted gate passed in 4m42s (run 42706135674), versus 8m11–8m33 and a fresh 8m56s base run.make checkpassed again after refreshing onto0a208d9c; all four real Postgres storage trials passed, with no repeatable tmpfs improvement.Risk & rollback
Cold optimized native compilation costs more; PR credentials remain read-only. Product Rust assertions, overflow checks and all existing test coverage remain intact. Revert the merge commit to restore the former profile and workflow.
Post-merge ledger
Closed by: Codex · session
Codex:01a1bef1-8627-7c21-8a86-6c4743d8906fonMac-46· 2026-11-09T23:22:21Zmainis green with this change on it —80c674ec79737cad385f81d4344f66a82234d637; full rust run 42709550901 passed in 4m56s; frontend, infra and devcontainer passed.images— 42709551896 passed; API digestsha256:341b5e8b9db700f0ca389e147b9f3d3e6bd446e9ace9b6e68fd140071de0bd91.deploy— 42710140151 deployed this merge SHA to both environments. Devweb-api-blue-6857ccf7f7-82hz9emitteder-server listeningat 22:16:04Z; prodweb-api-green-67556d5875-qb57semitted it at 22:15:46Z with that API digest (CloudWatch querye9ab2b7d-f260-4439-ade8-918f257610bc). Prod then passed the three-minute public readiness window and cut over at 22:19:54Z.Donewithout a manual move.backend-ci-profile.md, expanded in perf(ci): overlap token rotation and reuse server integration builds #1072, records the paired profiles, unchanged coverage, cache evidence and rejected alternatives. perf(ci): overlap token rotation and reuse server integration builds #1072’s ledger records final main timing (4m09s) and the corrected hardware verdict; raw profiling evidence remains local.Specific to this change
50de124e. Each had 1,061 identical attributed results, identical compiler/version and coverage digest, zero warm Rust/native misses and zero cache errors. x86 samples 131.557 / 131.230 / 142.074s, median 131.557s; ARM 118.782 / 114.897 / 115.751s, median 115.751s (12.01% faster for this selected-package build/test gate). This falls below the predeclared 15% migration threshold and is not a full-backend ARM result; retain existing free x86 runners. x86 priming also reused every Rust/native object from normal CI; ARM priming populated previously missing Rust objects. Do not compare unlike priming cache states as a hardware benchmark.Context — investigation and measurements
The committed
backend-ci-profile.mdreference records the method, baseline jobs, CPU profiling, alternatives and coverage decisions. Raw paired timings, Samply captures with symbols and interactive flame graphs are retained locally under/tmp/er-backend-profile-evidence.The slow incremental/full-equivalence test had a three-run median of 66.441 seconds at native level 0 and 11.294 at level 3. Levels 1–3 performed similarly; level 3 matches the native flags already cached by nightly benchmarks. Our Rust code remains unoptimized with assertions and overflow checks. Release builds already optimized DuckDB; this is not a claim of faster production queries.
The extension runner checks the exact Cargo package/target artifact, requires the community-extension test to exist, propagates failures and scopes the enabling environment to that binary. The full local rest-suite output contained 1,042 attributed results; metadata discovery rebuilt nothing.
The manual main-only hardware experiment uses three machines per architecture. Each primes the protected native cache, then times the real gate from an empty target. It rejects native cache misses/errors, changed or incompletely parsed test identities, and local/self-hosted target cleanup. All ARM tool archives were hash-verified and their executables tested in local Ubuntu ARM64 before publication. Normal required CI remains on its existing architecture until a complete comparison justifies changing it.