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

[PATCH 0/2] speed up reflog unreachability pruning

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 31, 2009, 17:03 UTC
Message-ID
<alpine.LFD.2.00.0903310958000.4093@localhost.localdomain>

Ok, this is a two-patch series that first tries to clean things up a bit, and then applies Junio's approach to speed up the reachability test.

The reason I did it this way is that I think we can improve on the reachability logic a bit more, but in order to do that I refuse to work with the crazy duplicated complex logic inside 'expire_reflog_ent()', and I wanted to abstract it out.

Then, the first cut at speedup is just Junio's approach. Which is fairly hacky, but works.

I'd _like_ to do more of a "dynamically do 'mark_reachable()' only when necessary" thing, but that's a separate cleanup thing.

As is, this improves the reflog expire quite enormously for me:
 - before:
	[torvalds@nehalem linux]$ time git reflog expire --all
	real	0m37.193s
	user	0m37.174s
	sys	0m0.020s
 - after:
	[torvalds@nehalem linux]$ time ~/git/git reflog expire --all
	real	0m1.693s
	user	0m1.672s
	sys	0m0.020s

although I do suspect that the 'mark_reachable()' could slow things down in some less extreme cases. But probably never by a huge amount.

Total diffstat:
 builtin-reflog.c |   75 +++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 69 insertions(+), 6 deletions(-)
with the two individual patches coming up next.
			Linus
Next: Linus Torvalds
Message 1 of 6 in “speed up reflog unreachability pruning”
  1. 0/2 speed up reflog unreachability pruningLinus Torvalds, Mar 31, 2009
  2. 1/2 Clean up reflog unreachability pruning decisionLinus Torvalds, Mar 31, 2009
  3. 2/2 Speed up reflog pruning of unreachable commitsLinus Torvalds, Mar 31, 2009
  4. Junio C HamanoMar 31, 2009
  5. Linus TorvaldsMar 31, 2009
  6. Junio C HamanoMar 31, 2009

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.