Repository navigation
ci(bench): compile once with the full backend set and 8 build jobs - #2249
Merged
smunini merged 2 commits intoOct 27, 2026
Merged
Conversation
Follow-up to #2248. - Always build the full feature set (R4,sqlite,postgres,mongodb,elasticsearch): narrowing it per leg saved only 2-4 min on a cold build and produced a different binary per dispatch. Remove build_features.py and its test. - Raise CARGO_BUILD_JOBS to 8 for the build job only. The runners have 8 CPUs and the compile is CPU-bound; measured cold, 2 jobs took 13-15 min, 4 jobs 7 min 03 s and 8 jobs 4 min 40 s with the same peak memory. - Drop the actions/cache step added in #2248: on a hit from another runner cargo still rebuilt the workspace crates (12 min 08 s in total), a restore cost 99-167 s and a miss paid 126-277 s to save. - The workflow still has a single cargo build, in the build job; every leg downloads its artifact. Keep needs: setup on the build job and update the comments that quoted a ~13-minute build. - README: rewrite the Build job section with the measurements. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cold ranges, memory wording (MemAvailable drop, not a peak), save times, header comment now says all four backends are always linked in. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
smunini
deleted the
feat/2247-fhir-benchmark-explicit-per-leg-indexing
branch
October 27, 2026 16:30
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Follow-up to #2248 (merged), refs #2247. Measurements taken after the merge showed that two parts of the benchmark
buildjob added there do not pay off: the per-leg feature narrowing and theactions/cacheof the release build. The real bottleneck wasCARGO_BUILD_JOBS: 2on 8-CPU runners. This PR builds one binary with every backend, compiles it with 8 jobs, and drops the cache. 5 files, 2 commits (the second only corrects wording and figures after an Opus 5.5 review).What this PR changes (before → after)
main@6f62064)build_features.py(for exampleR4,mongodb);backend=corebuilds the full setR4,sqlite,postgres,mongodb,elasticsearchsqlitehas no bulk-export sidecar for mongodb-based servers (crates/hfs/src/main.rs); the benchmark itself loads data with$bulk-submit, so it is not affected. Restoring another feature set's cache saved 43 scargo buildin thebuildjob; every leg downloadshfs-bench-binary-<run id>cargo buildin the workflow, now always the same binarygrep -n 'cargo build'on the workflow: one command (line 365), the other two hits are commentsCARGO_BUILD_JOBSof thebuildjobbuildjob only (needs: setupkept)MemAvailablefell by 7.2-7.4 GiB with 4 and with 8 jobs (2 jobs not measured)actions/cache)build_features.pyand its testEvidence
1. Compile time against
CARGO_BUILD_JOBSDispatches of
backend=sqlite tests=prewarmon throwaway branches (tmp/bench-steve-jobs4,tmp/bench-steve-jobs8, identical except the job count and a time and memory sampler aroundcargo build). All runners report 8 CPUs.target/"Memory drop" is the fall of
MemAvailableduring the build; the largest single process was about 4.5 GiB.The two warm rows are not comparable with the cold rows: the 4-job run started from an older build on its runner and the 8-job run reused the
target/of the 4-job cold run. A runner keepstarget/until another workflow checks out into the same workspace withclean: true(about 30 self-hosted jobs in 17 workflow files do), so a build can still start cold.2. Why the cache was dropped
R4,sqlitecold build 10 min 47 s, then 176 s to save a 1.05 GB entrytarget/was still warm: it is not typicalCorrection to #2248: its description and the README said a cache hit restores in about 100 s and rebuilds 2 crates in 49.8 s; that is the single sample in the last row. The cache was only ever judged with
CARGO_BUILD_JOBS=2; with 8 jobs a cold build (4 min 40 s) is already shorter than a typical hit (12 min 08 s).3. Checks
python3 -m unittest discoveron.github/scripts/fhir-benchwith an emptyHOME: 147 tests, OK, 1 skipped (the real-data smoke test).resolve-matrix.shpassesbash -n; no reference tobuild_features,bench-build,actions/cacheor a cache warmer remains.backend=sqlite tests=prewarm, run 40524593116): "Build HFS binary" succeeded on github-agent8 withCARGO_BUILD_JOBS: 8, 83 s for the build step and 6 s for the upload. That runner'starget/was warm (3 crates compiled), so this run confirms the job works, not the cold time.Known limits
MemAvailableand/usr/bin/time -v; it was not measured while another job shares the host.buildjob and its documentation change.🤖 Generated with Claude Code