Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v2 w/prune index] remote.c: avoid O(m*n) behavior in match_push_refs

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:58:02

Brandon Casey [off-list ref] writes:
...
Using an index takes 41 ms longer, or roughly 7.8% longer.

Jeff King measured a no-op push of a single ref into a remote repo
with 370,000 refs:

        before    after
real    0m1.087s  0m1.156s
user    0m1.344s  0m1.412s
sys     0m0.288s  0m0.284s

Using an index takes 69 ms longer, or roughly 6.3% longer.

None of the measurements above required transferring any objects to
the remote repository.  If the push required transferring objects and
updating the refs in the remote repository, the impact of preparing
the search index would be even smaller.

A similar operation is performed in the reverse direction when pruning
using a matching or pattern refspec.  Let's avoid O(m*n) behavior in
the same way by lazily preparing an index on the local refs.
Thanks.  Both the explanation and the code change makes sense to me.

Will queue.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help