Re: [hacky PATCH 0/2] speeding up trivial for-each-ref invocations
- From
Jeff King <peff@peff.net>
- Date
- Sep 5, 2021, 12:49 UTC
- Message-ID
- <YTS8yiYwR+eeZf4+@coredump.intra.peff.net>
- In-Reply-To
- <CAOLTT8RzHb5zWUm1psZRTP=iST-jP4DBmG2Zh1UPdo6z+QyHcg@mail.gmail.com>
On Sun, Sep 05, 2021 at 04:19:53PM +0800, ZheNing Hu wrote:
Show 6 quoted lines
> > In this version there are 2 patches, tested against 'git for-each-ref > > --format="%(objectname) %(refname)"' on a fully packed repo with 500k > > refs: > > > > Regarding this 500k refs, is there any way I can reproduce it?
Try this in a clone of linux.git (or any other repo):
git rev-list HEAD | head -500000 | perl -lne 'print "create refs/foo/$. $_"' | git update-ref --stdin
git pack-refs --all --prune
Though I actually think for these tests that it is not important that each ref point to a unique commit (we are not opening up the objects at all, and just treating the oids as strings).
-Peff