From: Stefan Sperling Subject: Re: Got is kinda slow To: Christian Weisgerber Cc: gameoftrees@openbsd.org Date: Sun, 16 Apr 2023 00:27:23 +0200 On Sat, Apr 15, 2023 at 09:40:19PM +0200, Christian Weisgerber wrote: > Based on something I did today: > > $ cd /usr/ports/devel/libpciaccess # FreeBSD ports > $ time git log -- . >/dev/null > 20.15 real 19.77 user 0.37 sys > $ time got log . >/dev/null > 460.48 real 459.54 user 0.85 sys > > Ouch. How many pack files does this repository contain in objects/pack? If it it more than 32 please run git repack -a and try it again. If there are too many pack files we keep starting got-read-pack over and over and this makes things slow. I have ideas how to fix this: We need to make a given got-read-pack process read from multiple pack files. And store tiny pack files in memory rather than wasting a file descriptor on them. That would allow us to cache a lot more packs than we do now and speed things up a lot when many packs exist. The current design with one process per pack file, each requiring multiple file descriptors in the main process, allows too few packs to be cached when running with default ulimit -n.