git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 8, 2013, 16:12 UTC
Message-ID
<7vmwpx1156.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1373273919-32005-1-git-send-email-drafnel@gmail.com>
Brandon Casey <drafnel@gmail.com> writes:
Show 21 quoted lines
> ...
> 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.
Previous: Brandon Casey
Message 12 of 12 in “remote.c: avoid O(n^2) behavior in match_push_refs by using string_list”
  1. remote.c: avoid O(n^2) behavior in match_push_refs by using string_listBrandon Casey, Jul 2, 2013
  2. Jeff KingJul 3, 2013
  3. Brandon CaseyJul 3, 2013
  4. Junio C HamanoJul 3, 2013
  5. Jeff KingJul 3, 2013
  6. Brandon CaseyJul 3, 2013
  7. Brandon CaseyJul 3, 2013
  8. Junio C HamanoJul 3, 2013
  9. remote.c: avoid O(m*n) behavior in match_push_refsBrandon Casey, Jul 8, 2013
  10. Jeff KingJul 8, 2013
  11. remote.c: avoid O(m*n) behavior in match_push_refsBrandon Casey, Jul 8, 2013
  12. Junio C HamanoJul 8, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.