commit 159a21e5a66248bba48b1b665ff4c2c3c61b2240 from: Stefan Sperling date: Tue Mar 30 00:48:38 2021 UTC increase pack index cache size from 16 to 64 to improve performance This can make a huge difference on repositories which contain more than 16 pack files, at the expense of additional open file handles. My test case was a ports.git repository with > 60 pack files (these accumulate due to 'got fetch', and 'git repack -a' would condense them). With cache size 16 'got update' in /usr/ports took more than 60 seconds. With cache size 64 the same command took less than 5 seconds. The root cause is probably that mapping and unmapping large files over and over again is expensive on OpenBSD. commit - 4d9042b347e757448bd0dff60537fe57e1af5ad1 commit + 159a21e5a66248bba48b1b665ff4c2c3c61b2240 blob - 18d2953bb12aa27108f0941f598a0b1d40a0c1ab blob + 926534be5a780a41e69bd370a8511f00d7fcc19a --- lib/got_lib_repository.h +++ lib/got_lib_repository.h @@ -28,7 +28,7 @@ #define GOT_OBJECTS_PACK_DIR "objects/pack" #define GOT_PACKED_REFS_FILE "packed-refs" -#define GOT_PACKIDX_CACHE_SIZE 16 +#define GOT_PACKIDX_CACHE_SIZE 64 #define GOT_PACK_CACHE_SIZE GOT_PACKIDX_CACHE_SIZE struct got_repository {