From: Stefan Sperling Subject: Re: speed up got patch To: Omar Polo Cc: gameoftrees@openbsd.org Date: Fri, 13 May 2022 13:28:53 +0200 On Fri, May 13, 2022 at 01:01:14PM +0200, Omar Polo wrote: > The worktree schedule functions are quite heavy because they open the > fileindex and sync the changes afterwards. Opening, syncing and closing > the fileindex in a loop once per every patch wastes a lot of time for no > real gain. The initial implementation of rebase had the same problem. Opening and syncing the fileindex in /usr/src takes time, which is why it is done only just once by most (if not all) commands by now. So your approach to fix this makes sense, and matches what has already been done elsewhere. > P.S.: I don't particularly like the got_patch_state name I came up with > but don't have any better ideas. If you don't like this, you could pass struct got_fileindex * and char *fileindex_path arguments around as needed, without putting them into a wrapper struct.