From: Omar Polo Subject: Re: optimize tree_path_changed() To: Stefan Sperling Cc: gameoftrees@openbsd.org Date: Mon, 24 Apr 2023 12:23:21 +0200 On 2023/04/23 23:45:45 +0200, Stefan Sperling wrote: > This patch avoids having to parse and sort all entries of two trees > in order to figure out whether a particular entry has changed. > > Instead, we now decode entries one-by-one until we find an entry that > matches the path being logged. We also compare entries in the on-disk > sorting order rather than got_path_cmp() order. As long as the order > is stable (which it is supposed to be on disk) this works as avoids > having to sort thousands of entries over and over when traversing a > large repository like freebsd-ports.git. Other parts of Got still rely > on got_path_cmp() order and are not affected by this change. > > ok? haven't done any benchmarking, but it reads fine and regress is passing. ok op@