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

Re: pack-object's try_delta fast path for v2 trees?

From
Nicolas Pitre <nico@fluxnic.net>
Date
Oct 12, 2013, 14:52 UTC
Message-ID
<alpine.LFD.2.03.1310121042290.3023@syhkavp.arg>
In-Reply-To
<CACsJy8Behb7PW=pFjH=wpjfHjUiyCo8n_ER+KyzcBwCzpyG6pg@mail.gmail.com>
On Sat, 12 Oct 2013, Duy Nguyen wrote:
Show 10 quoted lines
> Hi,
> 
> Just wondering if this has been considered and dropped before.
> Currently we use try_delta() for every object including trees. But
> trees are special. All tree entries must be unique and sorted. That
> helps simplify diff algorithm, as demonstrated by diff_tree() and
> pv4_encode_tree(). A quick and dirty test with test-delta shows that
> tree_diff only needs half the time of diff_delta(). As trees account
> for like half the objects in a repo, speeding up delta search might
> help performance, I think.

Fortaking advantage of the sorted nature of tree objects, you need to actually parse those objects to determine tree entry boundaries. The delta diff code doesn't parse anything and simply do a search into a binary buffer which may or may not end up slicing that buffer on actual tree entry boundaries.

So this could help somewhat, however the need for pre-parsing those tree objects is probably going to counter-balance all the performance gain you might get.

I think the potential for improvements would be greater by moving to pack v4 (when the right algorithm is in place that is). Eventually the proper pack v4 tree delta diffing code could be made to serve the pack v2 case as well.

Nicolas
Previous: Duy NguyenNext: Jeff King
Message 2 of 8 in “pack-object's try_delta fast path for v2 trees?”
  1. Duy NguyenOct 12, 2013
  2. Nicolas PitreOct 12, 2013
  3. Jeff KingOct 15, 2013
  4. Duy NguyenOct 15, 2013
  5. Jeff KingOct 15, 2013
  6. Nicolas PitreOct 15, 2013
  7. Jeff KingOct 15, 2013
  8. Nicolas PitreOct 15, 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.