Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Junio C Hamano
Brandon Casey writes: >> ... by penalizing the common case by how much? If it is not too >> much, then this obviously would be a good change. > > For something the size of the git repo, 5 branches, and pushing with > matching refspecs, I can't measure any difference. The fastest time I > record

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Brandon Casey
On 7/3/2013 12:00 PM, Jeff King wrote: > On Wed, Jul 03, 2013 at 11:40:12AM -0700, Junio C Hamano wrote: > >> Brandon Casey writes: >> >>> Right. For repos with few refs on either side, I don't think there >>> will be any measurable difference. When pushing a single ref to a >>> repo with a ver

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Brandon Casey
On 7/3/2013 11:40 AM, Junio C Hamano wrote: > Brandon Casey writes: > >> Right. For repos with few refs on either side, I don't think there >> will be any measurable difference. When pushing a single ref to a >> repo with a very large number of refs, we will see a very small net >> loss for the

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Jeff King
On Wed, Jul 03, 2013 at 11:40:12AM -0700, Junio C Hamano wrote: > Brandon Casey writes: > > > Right. For repos with few refs on either side, I don't think there > > will be any measurable difference. When pushing a single ref to a > > repo with a very large number of refs, we will see a very s

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Junio C Hamano
Brandon Casey writes: > Right. For repos with few refs on either side, I don't think there > will be any measurable difference. When pushing a single ref to a > repo with a very large number of refs, we will see a very small net > loss for the time required to prepare the string list (which gro

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-03 Thread Brandon Casey
On Tue, Jul 2, 2013 at 11:23 PM, Jeff King wrote: > On Tue, Jul 02, 2013 at 04:53:48PM -0700, Brandon Casey wrote: > >> From: Brandon Casey >> >> When pushing, each ref in the local repository must be paired with a >> ref advertised by the remote server. Currently, this is performed by >> first

Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-02 Thread Jeff King
On Tue, Jul 02, 2013 at 04:53:48PM -0700, Brandon Casey wrote: > From: Brandon Casey > > When pushing, each ref in the local repository must be paired with a > ref advertised by the remote server. Currently, this is performed by > first applying the refspec to the local ref to transform the loc

[PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list

2013-07-02 Thread Brandon Casey
From: Brandon Casey When pushing, each ref in the local repository must be paired with a ref advertised by the remote server. Currently, this is performed by first applying the refspec to the local ref to transform the local ref into the name of the remote ref, and then performing a linear searc