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

[PATCH 0/4] optimizing upload-pack ref peeling

From
Jeff King <peff@peff.net>
Date
Oct 4, 2012, 07:56 UTC
Message-ID
<20121004075609.GA1355@sigill.intra.peff.net>
In-Reply-To
<CACBZZX5Sm++Wjyoue-qk7TjwxUM3QihXfWGtEHhOq=VtkgvNbQ@mail.gmail.com>
On Thu, Oct 04, 2012 at 01:54:47AM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 8 quoted lines
> > Hmm. It seems like we should not need to open the tags at all. The main
> > reason is to produce the "peeled" advertisement just after it. But for a
> > packed ref with a modern version of git that supports the "peeled"
> > extension, we should already have that information.
> 
> B.t.w. do you plan to submit this as a non-hack, I'd like to have it
> in git.git, so if you're not going to I could pick it up and clean it
> up a bit. But I think it would be better coming from you.

Here's a cleaned-up version. I realized that peel_ref actually is quite close to what we want; the key thing is that when you are calling it from a for_each_ref loop it will not only use peeled information from packed-refs (if available), but it will also short-circuit the ref lookup for non-packed refs. So it really does what we want.

I put some timings into the final patch. The results are very satisfying from a pure numbers standpoint. However, I'm not 100% sure this is all that useful a benchmark. The repos where you get a noticeable benefit are quite big, so I suspect the time to send the advertisements out over the wire will dominate. Still, a CPU second saved is a CPU second earned.

And the series actually ends up making the code cleaner and shares some of the optimizations I put into upload-pack with other users of peel_ref. So I think I'd be inclined to use it, even if the speedup doesn't help that much in practice. We'll see what others think.

  [1/4]: peel_ref: use faster deref_tag_noverify
  [2/4]: peel_ref: do not return a null sha1
  [3/4]: peel_ref: check object type before loading
  [4/4]: upload-pack: use peel_ref for ref advertisements
-Peff
Next: Jeff King
Message 1 of 14 in “optimizing upload-pack ref peeling”
  1. 0/4 optimizing upload-pack ref peelingJeff King, Oct 4, 2012
  2. 1/4 peel_ref: use faster deref_tag_noverifyJeff King, Oct 4, 2012
  3. Junio C HamanoOct 4, 2012
  4. 2/4 peel_ref: do not return a null sha1Jeff King, Oct 4, 2012
  5. Junio C HamanoOct 4, 2012
  6. 3/4 peel_ref: check object type before loadingJeff King, Oct 4, 2012
  7. Junio C HamanoOct 4, 2012
  8. Jeff KingOct 4, 2012
  9. Junio C HamanoOct 4, 2012
  10. Jeff KingOct 4, 2012
  11. 4/4 upload-pack: use peel_ref for ref advertisementsJeff King, Oct 4, 2012
  12. Jeff KingOct 4, 2012
  13. Ævar Arnfjörð BjarmasonOct 4, 2012
  14. Nazri RamliyOct 4, 2012

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.