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

Re: Re-Transmission of blobs?

From
Jeff King <peff@peff.net>
Date
Sep 12, 2013, 19:56 UTC
Message-ID
<20130912195654.GE32069@sigill.intra.peff.net>
In-Reply-To
<871B6C10EBEFE342A772D1159D132085571A7A1B@umechphj.easf.csd.disa.mil>
On Thu, Sep 12, 2013 at 12:45:44PM +0000, Pyeron, Jason J CTR (US) wrote:
Show 10 quoted lines
> If the rules of engagement are change a bit, the server side can be release from most of its work (CPU/IO).
> 
> Client does the following, looping as needed:
> 
> Heads=server->heads();
> KnownCommits=Local->AllCommits();
> Missingblobs=[];
> Foreach(commit:heads) if (!knownCommits->contains(commit)) MissingBlobs[]=commit;
> Foreach(commit:knownCommit) if (!commit->isValid()) MissingBlobs[]=commit->blobs();
> If (missingBlobs->size()>0) server->FetchBlobs(missingBlobs);

That doesn't quite work. The client does not know the set of missing objects just from the commits. It knows the sha1 of the root trees it is missing. And then if it fetches those, it knows the sha1 of any top-level entries it is missing. And when it gets those, it knows the sha1 of any 2nd-level entries it is missing, and so forth.

You can progressively ask for each level, but:
  1. You are spending a round-trip for each request. Doing it per-object
     is awful (the dumb http walker will do this if the repo is not
     packed, and it's S-L-O-W). Doing it per-level would be better, but
     not great.
  2. You are losing opportunities for deltas (or you are making the
     state the server needs to maintain very complicated, as it must
     remember from request to request which objects you have gotten that
     can be used as delta bases).
  3. There is a lot of overhead in this protocol. The client has to
     mention each object individually by sha1. It may not seem like a
     lot, but it can easily add 10% to a clone (just look at the size of
     the pack .idx files versus the packfiles themselves).
-Peff
Previous: Pyeron, Jason J CTR (US)Next: Pyeron, Jason J CTR (US)
Message 15 of 19 in “Re-Transmission of blobs?”
  1. Josef WolfSep 10, 2013
  2. Junio C HamanoSep 10, 2013
  3. Josef WolfSep 11, 2013
  4. Junio C HamanoSep 11, 2013
  5. Josef WolfSep 12, 2013
  6. Jeff KingSep 12, 2013
  7. Josef WolfSep 12, 2013
  8. Jeff KingSep 12, 2013
  9. Josef WolfSep 13, 2013
  10. Jeff KingSep 16, 2013
  11. Josef WolfSep 20, 2013
  12. Jeff KingSep 24, 2013
  13. Josef WolfSep 24, 2013
  14. Pyeron, Jason J CTR (US)Sep 12, 2013
  15. Jeff KingSep 12, 2013
  16. Pyeron, Jason J CTR (US)Sep 12, 2013
  17. Josef WolfSep 13, 2013
  18. Jason PyeronSep 13, 2013
  19. Duy NguyenSep 13, 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.