You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Post step: defer mirror repacks until 50 small packs, cutting the post step from 14s to 3s on large mirrors - #67
After every sync, the post step runs git repack --geometric=2 on the mirror. On a large mirror that repack takes about as long however little the sync fetched, and every job that commits pays it. In a full CI run of a large open-source monorepo (12.6 GiB mirror, ~220 jobs), the post step averaged 14.4s and reached 56s.
Change
Skip the repack until 50 small packs have built up, which is git's gc.autoPackLimit default. The rest of mirror maintenance is unchanged.
Results
Before
After
Post step mean, full CI run
14.4s
3.3s
Post step max, full CI run
56s
7s
Jobs that repacked, one day of CI
all 37k committing jobs
612
Post-step time, one day of CI
~149 job-hours
~36 job-hours
CI runs: before and after are separate runs of the repo's CI on a fork.
One-day rows: the repo's CI jobs from 2026-11-10, replayed through a model of the mirror's snapshots. The post-step totals apply the CI runs' per-job means to those jobs.
Trade-off
Once every ~50 snapshots, the jobs that start from that snapshot still pay a repack, as every job does today. That is the 612 jobs above, 18 times in the day.
Tests
New: maintenance skips the repack below the limit and repacks at it.
Updated mirror-cleanup and mirror-gc-git tests for the limit.
Created with Claude Opus 5.5 in Claude Code.
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need. (Staging)
Post step skips mirror repack below 50 small packs
With the rebuilt dist, the post step still skips the repack below 50 small packs (about 3s down to about 0.16s per job under 8-way load) and still rolls up at 50, leaving the same refs and objects as before.
Merge-base
This PR 6217720a
Caution
New issue found while testing
Large sync packs never reach the roll-up limit
With 55 sync packs of 10 MiB, deferral leaves 30 small packs, so every post step skips the repack and the mirror stays at 61 packs. Before, three jobs folded it to 4 packs.
Merge-base
This PR 6217720a
Proof on 6217720a (from ade2fa32) · mocked: Sticky-disk Git mirror (Each job gets a local copy of a public repo's bare mirror with synthetic sync pa...) · not run: Blacksmith VM agent (sticky disk gRPC) (Only exists on Blacksmith runners; the post step's commit call fails after maint...) · Did Proof get it right? Yes · No
jahands
changed the title
Post step: defer mirror roll-ups until 50 small packs (post step 20s → 3s under load)
Post step: defer mirror repacks until 50 small packs, cutting the post step from ~15s to ~3s on large mirrors
Nov 11, 2026
jahands
changed the title
Post step: defer mirror repacks until 50 small packs, cutting the post step from ~15s to ~3s on large mirrors
Post step: defer mirror repacks until 50 small packs, cutting the post step from 14s to 3s on large mirrors
Nov 11, 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
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.
Problem
After every sync, the post step runs
git repack --geometric=2on the mirror. On a large mirror that repack takes about as long however little the sync fetched, and every job that commits pays it. In a full CI run of a large open-source monorepo (12.6 GiB mirror, ~220 jobs), the post step averaged 14.4s and reached 56s.Change
Skip the repack until 50 small packs have built up, which is git's
gc.autoPackLimitdefault. The rest of mirror maintenance is unchanged.Results
Trade-off
Once every ~50 snapshots, the jobs that start from that snapshot still pay a repack, as every job does today. That is the 612 jobs above, 18 times in the day.
Tests
mirror-cleanupandmirror-gc-gittests for the limit.Created with Claude Opus 5.5 in Claude Code.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need. (Staging)