From: "Omar Polo" Subject: Re: delta cache improvement for got-index-pack To: Stefan Sperling Cc: gameoftrees@openbsd.org Date: Wed, 25 Feb 2026 07:51:29 +0100 Stefan Sperling wrote: > Cloning ports.git with 'got clone' is quite slow, more than 10 minutes. > I have been looking for ways to improve this. I have found a way to speed > up indexing of the pack file, specifically the "resolving deltas" step. > > The diff below increases delta cache hit rate during got-index-pack from > 60% to 90% when indexing a full pack of the ports.git repository. > In my test case, where I use a ports.git repository with history between > 1995 and 2016, the time taken to index the full pack file is reduced from > 90 seconds to 30 seconds. > > As a bonus, memory usage decreases on average since we keep fewer deltas > in cache than before. Set an uppper limit on cache entries to keep memory > usage within reasonable limits. The maximum is now about 1.2GB in the > contrived case where all deltas and fulltexts are of the maximum size > allowed. In practice we hover at around 500 MB with ports.git. > The previous theoretical maximum was about 2GB. > > ok? why not. okay op@ > > diff /home/stsp/src/got > path + /home/stsp/src/got > commit - d07cf78033793607c02ab0e8bcb66de1f4a02a6f > blob - f4573ec7892464be6d8b1d3a6baf3decade28e4c