grit://cooking/bench/restore/hunks@large-file
← cookingall benchmarksraw data

grit restore · hunks @large-file

Discard half of 500 hunks in a 50k-line file: grit restore --hunks vs git apply -R

repo: synth-10k extended by one committed 50k-line large.txt, modified into 500 hunks; file/commit counts derived from recounted base plus that setup step · 10,001 files · 1,001 commits · 800 refs

$ grit-bench daily --only restore/hunks@large-file2026-10-27 · grit 8dbc58e77 · git version 2.43.0
toolmedianminmaxrunspeak memory
git7.0 ms6.5 ms7.8 ms208.1 MB
grit21 ms21 ms22 ms2027 MB
grit is 3.0× slowermemory: 3.4× more
every timed run (log scale)
git
grit
5.2 ms28 ms
How it's measured
before each run
grit-bench prepare-worktree-add-hunks --git git
git runs
$ git apply -R /tmp/grit-bench-scratch/daily-synth-10k/hunks-half.patch
grit runs
$ H=$(cat '/tmp/grit-bench-scratch/daily-synth-10k/hunks-half.ids') && grit restore --hunks "$H" -- large.txt
Where the time goesone extra traced run per tool, outside the timed runs
git
— not traced
grit · median run 21 ms
grit.index.read ×5
3.6 ms
grit.repository.open
0.2 ms
grit.config.load ×2
0.1 ms
grit.pack.index.open
0.0 ms
Every day8 days
dategrit commitgitgritgrit vs gitgrit peak
2026-10-278dbc58e777.0 ms21 ms3.0× slower27 MB
2026-10-26c7cf2c443—not run——
2026-10-252824ad391—not run——
2026-10-24157a05dde—not run——
2026-10-23bddf92f868.7 ms76 ms8.8× slower47 MB
2026-10-224c131b942—not run——
2026-10-21d4844e92a—not run——
2026-10-204754ad0b9—not run——