Git fork

t/perf/lib-pack: use fast-import checkpoint to create packs

We currently use fast-import only to create a large number
of objects, and then run O(n) invocations of pack-objects to
turn them into packs.

We can do this faster by just asking fast-import to
checkpoint and create a pack for each (after telling it
not to turn loose tiny packs).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Jeff King and committed by
Junio C Hamano
0a11e402 aa338d35

+3 -7
+3 -7
t/perf/lib-pack.sh
··· 9 9 print "data <<EOF"; 10 10 print "$_"; 11 11 print "EOF"; 12 + print "checkpoint" 12 13 } 13 14 ' "$@" | 14 - git fast-import && 15 - 16 - git cat-file --batch-all-objects --batch-check='%(objectname)' | 17 - while read sha1 18 - do 19 - echo $sha1 | git pack-objects .git/objects/pack/pack 20 - done 15 + git fast-import 21 16 } 22 17 23 18 # create a large number of packs, disabling any gc which might ··· 25 20 setup_many_packs () { 26 21 git config gc.auto 0 && 27 22 git config gc.autopacklimit 0 && 23 + git config fastimport.unpacklimit 0 && 28 24 create_packs 500 29 25 }