Re: [PATCH] send-pack: use OBJECT_INFO_QUICK to check negative objects
- From
- Patrick Marlier (pamarlie) <pamarlie@cisco.com>
- Date
- Nov 29, 2019, 09:22 UTC
- Message-ID
- <CH2PR11MB4294A6C1AA71DF1A1721C94CCF460@CH2PR11MB4294.namprd11.prod.outlook.com>
- In-Reply-To
- <20191127123211.GG22221@sigill.intra.peff.net>
Show 10 quoted lines
> On Tue, Nov 19, 2019 at 01:12:51PM +0000, Patrick Marlier (pamarlie) wrote: >> I am hitting a performance issue with "git push <remote> <refspec>". >> The local repository has only few refs and the remote repository has a >> lot of refs (1000+) with objects unknown to the local repository. >> >> "git push" of only one refspec takes minutes to complete. A quick >> analysis shows that a lot of time is spent in the client side. >> A deeper analysis shows that the client receives the entire list of >> refs on the remote, then the client is checking in its local >> repository if the objects exist for all remote refs.
>Right, this is expected. The client send-pack feeds the list of remote >objects (that it has) to pack-objects, which can then limit the size of >the packfile it sends based on what the other side has.
Show 6 quoted lines
>So the patch you showed (to skip refs that aren't part of the push) >would miss many opportunities for a smaller push. E.g., imagine I create >a new branch "topic" from the remote branch "master", and then try to >push it up. If I do not look at which objects are in "master", I'll end >up sending the whole history again, when I really just need to send the >differences between the two.
Thanks Jeff. Indeed it makes sense. (My very particular use-case would have a limited impact in this case)
Show 6 quoted lines
>> Since the local repository has a only few refs, most of the objects >> are unknown. >> >> This issue is particularly amplified because the local repository is >> using many alternates. Indeed for each unknown object, git will try to >> find in all alternates too.
> I think the patch below would help you.
I will give a try next week and I keep you posted on how it goes.
Thanks a lot for your input and the patch!
Have a nice day, -- Pat