From: Derrick Stolee Date: Thu, 17 Jan 2019 15:09:18 GMT Subject: Re: [PATCH] commit-graph write: use pack order when finding commits Message-ID: <5b1146a1-9ec6-f30e-80e9-cb7cd4dc1a58@gmail.com> In-Reply-To: <20190117132345.29791-1-avarab@gmail.com> On 1/17/2019 8:23 AM, Ævar Arnfjörð Bjarmason wrote: > Slightly optimize the "commit-graph write" step by using > FOR_EACH_OBJECT_PACK_ORDER with for_each_object_in_pack(). See commit > [1] and [2] for the facility and a similar optimization for "cat-file". > > On Linux it is around 5% slower to run: > > echo 1 >/proc/sys/vm/drop_caches && > cat .git/objects/pack/* >/dev/null && > git cat-file --batch-all-objects --batch-check --unordered > > Than the same thing with the "cat" omitted. This is as expected, since > we're iterating in pack order and the "cat" is extra work. > > Before this change the opposite was true of "commit-graph write". We > were 6% faster if we first ran "cat" to efficiently populate the FS > cache for our sole big pack on linux.git than if we had it populated > via for_each_object_in_pack(). Now we're 3% faster without the "cat" > instead. > > The tests were done on an unloaded Linux 3.10 system with 10 runs for > each. > > 1. 736eb88fdc ("for_each_packed_object: support iterating in > pack-order", 2018-08-10) > > 2. 0750bb5b51 ("cat-file: support "unordered" output for > --batch-all-objects", 2018-08-10) Thanks, Aevar! I plan to give this a test on the Windows repository, as this is the way we generate the commit-graph in VFS for Git. I created a PR on microsoft/git [1] and am generating the installers now [2] [1] https://github.com/Microsoft/git/pull/110 [2] https://dev.azure.com/gvfs/ci/_build/results?buildId=6114 The code itself looks good, I just need to double-check the performance numbers. Thanks, -Stolee