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
| tool | median | min | max | runs | peak memory |
|---|---|---|---|---|---|
| git | 7.0 ms | 6.5 ms | 7.8 ms | 20 | 8.1 MB |
| grit | 21 ms | 21 ms | 22 ms | 20 | 27 MB |
$ git apply -R /tmp/grit-bench-scratch/daily-synth-10k/hunks-half.patch
$ H=$(cat '/tmp/grit-bench-scratch/daily-synth-10k/hunks-half.ids') && grit restore --hunks "$H" -- large.txt
| date | grit commit | git | grit | grit vs git | grit peak |
|---|---|---|---|---|---|
| 2026-10-27 | 8dbc58e77 | 7.0 ms | 21 ms | 3.0× slower | 27 MB |
| 2026-10-26 | c7cf2c443 | — | not run | — | — |
| 2026-10-25 | 2824ad391 | — | not run | — | — |
| 2026-10-24 | 157a05dde | — | not run | — | — |
| 2026-10-23 | bddf92f86 | 8.7 ms | 76 ms | 8.8× slower | 47 MB |
| 2026-10-22 | 4c131b942 | — | not run | — | — |
| 2026-10-21 | d4844e92a | — | not run | — | — |
| 2026-10-20 | 4754ad0b9 | — | not run | — | — |