Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:59

Possibly related (same subject, not in this thread)

Brandon Casey [off-list ref] writes:
quoted
... 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 with or without this patch is the same:

   $ time git push -n
   real    0m0.178s
   user    0m0.020s
   sys     0m0.008s

Ditto, when only pushing a single branch.  Preparing the string list for
a repo with a "normal" number of refs has very little overhead.
My repository git.git and Linus's kernel are not "normal".  It did
not matter so far to have O(n*m) when pushing to our histories.

The case that matters is for somebody to be pushing one (or a few)
refs against a repository with many many refs, like pushing a review
request to Gerrit instance, which I think Martin has in mind.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help