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

Re: [PATCH] list-objects: mark fewer commits as edges for non-shallow clones

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 11, 2014, 19:13 UTC
Message-ID
<xmqqvblidmp1.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1418269615-139571-1-git-send-email-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 7 quoted lines
> In commit fbd4a70 (list-objects: mark more commits as edges in
> mark_edges_uninteresting - 2013-08-16), we made --thin much more
> aggressive by reading lots more trees.  This produces much smaller packs
> for shallow clones; however, it causes a significant performance
> regression for non-shallow clones with lots of refs (23.322 seconds vs.
> 4.785 seconds with 22400 refs).  Limit this extra edge-marking to
> shallow clones to avoid poor performance.

This change affects non-clone/fetch uses of object listing depending on the shallowness of the repository, and does not even care if it is driven as part of the pack-object codepath, if I am reading it correctly. It smells wrong.

The problematic fbd4a70 already had unintended fallout that needed to be corrected with 200abe74 (list-objects: only look at cmdline trees with edge_hint, 2014-01-20). The current code with the fix, the decision to use the more expensive marking is tied to "edge_hint". I notice that edge_hint is turned on only if the caller of rev-list passes the "--objects-edge" option, and currently that only happens in the pack-objects codepath when "thin" is given. Perhaps that part should decide if it really wants to do edge_hint depending on the shallowness of the repository perhaps?

That is, something like this instead?
 builtin/pack-objects.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 3f9f5c7..a9ebf56 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -2709,7 +2709,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 		usage_with_options(pack_usage, pack_objects_options);
 
 	argv_array_push(&rp, "pack-objects");
-	if (thin) {
+	if (thin && is_repository_shallow()) {
 		use_internal_rev_list = 1;
 		argv_array_push(&rp, "--objects-edge");
 	} else
Previous: brian m. carlsonNext: Junio C Hamano
Message 11 of 14 in “Poor push performance with large number of refs”
  1. brian m. carlsonDec 10, 2014
  2. Shawn PearceDec 10, 2014
  3. brian m. carlsonDec 10, 2014
  4. push: add remote.pushThin to control thin pack generationbrian m. carlson, Dec 10, 2014
  5. brian m. carlsonDec 11, 2014
  6. Duy NguyenDec 11, 2014
  7. brian m. carlsonDec 11, 2014
  8. list-objects: mark fewer commits as edges for non-shallow clonesbrian m. carlson, Dec 11, 2014
  9. Duy NguyenDec 11, 2014
  10. brian m. carlsonDec 20, 2014
  11. Junio C HamanoDec 11, 2014
  12. Junio C HamanoDec 11, 2014
  13. brian m. carlsonDec 20, 2014
  14. Duy NguyenDec 10, 2014

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.