From: Derrick Stolee Date: Tue, 30 Nov 2021 18:38:07 GMT Subject: Re: [PATCH v3 5/5] unpack-objects: unpack_non_delta_entry() read data in a stream Message-ID: <446c3677-140f-3033-138f-1ef9b1f546a5@gmail.com> In-Reply-To: On 11/30/2021 8:49 AM, Han Xin wrote: > On Tue, Nov 30, 2021 at 1:37 AM Derrick Stolee wrote: >> $ hyperfine \ >> --prepare 'rm -rf dest.git && git init --bare dest.git' \ >> -n 'old' '~/_git/git-upstream/git -C dest.git unpack-objects > -n 'new' '~/_git/git/git -C dest.git unpack-objects > -n 'new (small threshold)' '~/_git/git/git -c core.bigfilethreshold=64k -C dest.git unpack-objects > >> Benchmark 1: old >> Time (mean ± σ): 20.835 s ± 0.058 s [User: 14.510 s, System: 6.284 s] >> Range (min … max): 20.741 s … 20.909 s 10 runs >> >> Benchmark 2: new >> Time (mean ± σ): 26.515 s ± 0.072 s [User: 19.783 s, System: 6.696 s] >> Range (min … max): 26.419 s … 26.611 s 10 runs >> >> Benchmark 3: new (small threshold) >> Time (mean ± σ): 26.523 s ± 0.101 s [User: 19.805 s, System: 6.680 s] >> Range (min … max): 26.416 s … 26.739 s 10 runs >> >> Summary >> 'old' ran >> 1.27 ± 0.00 times faster than 'new' >> 1.27 ± 0.01 times faster than 'new (small threshold)' >> >> (Here, 'old' is testing a compiled version of the latest 'master' >> branch, while 'new' has your patches applied on top.) >> >> Notice from this example I had a pack with many small objects (mostly >> commits and trees) and I see that this change introduces significant >> overhead to this case. >> >> It would be nice to understand this overhead and fix it before taking >> this change any further. >> >> Thanks, >> -Stolee > > Can you show me the specific information of the repository you > tested, so that I can analyze it further. I used a pack-file from an internal repo. It happened to be using partial clone, so here is a repro with the git/git repository after cloning this way: $ git clone --no-checkout --filter=blob:none https://github.com/git/git (copy the large .pack from git/.git/objects/pack/ to big.pack) $ hyperfine \ --prepare 'rm -rf dest.git && git init --bare dest.git' \ -n 'old' '~/_git/git-upstream/git -C dest.git unpack-objects