Skip to content

Prime warm Git benchmark caches once - #2846

Draft
zaniebot wants to merge 1 commit into
mainfrom
zb/bench-git-warm-cache
Draft

zaniebot wants to merge 1 commit into
mainfrom
zb/bench-git-warm-cache

Conversation

@zaniebot

Copy link
Copy Markdown
Collaborator

The warm Git benchmarks prime a fresh cache every time Criterion invokes their callback, including warm-up and each sample. With the Django fixture, that repeatedly pays for a cold fetch outside the measured loop and extends the benchmark job.

Retain a lazily initialized cache for each warm case so priming happens once per benchmark. Filtered-out cases do not prime a cache.

@zaniebot zaniebot added build:skip-docker Skip Docker builds for this pull request internal A refactor or improvement that is not user-facing build:skip-release Disable building release binaries for a pull request labels Oct 16, 2026
@zaniebot
zaniebot deployed to automations October 16, 2026 19:23 — with GitHub Actions Active
@astral-automations-bot astral-automations-bot Bot added the area:benchmarks Related to benchmarking label Oct 16, 2026
@zaniebot

Copy link
Copy Markdown
Collaborator Author

In this comparison, git_fetch elapsed time fell by 4m56s (46%).

Measurement Base This PR Reduction
Nine warm Git cases, including setup 5m47s 55.5s 84%
Complete git_fetch suite 10m39s 5m43s 46%
Run benchmarks step 13m03s 8m05s 38%
Complete walltime run job 14m12s 10m10s 28%

Compared the base commit 1d62f57d with this PR at d71256b94, both on codspeed-macro-x64-ryzen-9950x-ubuntu-24-04. All 15 Git cases still collected 10 samples each. The six cold cases took 4m52s → 4m47s; most of the reduction is in the warm cases. Each Django warm case fell from 94–105s to 9–10s.

Workflow creation to walltime completion was 31m17s → 22m26s, including build and scheduling variation. Artifact download grew from 51s to 1m49s, reducing the gain in the complete run job. These are single-run observations; suite and case durations come from log timestamps, and step/job durations come from GitHub Actions.

@codspeed

codspeed Bot commented Oct 16, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 8 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 69 untouched benchmarks
⏩ 35 skipped benchmarks1


Comparing zb/bench-git-warm-cache (d71256b) with main (1d62f57)

Open in CodSpeed

Footnotes

  1. 35 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:benchmarks Related to benchmarking build:skip-docker Skip Docker builds for this pull request build:skip-release Disable building release binaries for a pull request internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant