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

Re: [PATCH 1/1] fetch: add trace2 instrumentation

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 6, 2019, 12:30 UTC
Message-ID
<nycvar.QRO.7.76.6.1911061329340.46@tvgsbejvaqbjf.bet>
In-Reply-To
<4fdbb9f504ee59e508b7df520f7890e29fbca7df.1572981981.git.gitgitgadget@gmail.com>
Hi Erik,
On Tue, 5 Nov 2019, Erik Chen via GitGitGadget wrote:
Show 24 quoted lines
> From: Erik Chen <erikchen@chromium.org>
>
> Add trace2 regions to fetch-pack.c to better track time spent in the various
> phases of a fetch:
>
>     * matching common remote and local refs
>     * marking local refs as complete (part of the matching process)
>
> Both of these stages can be slow for repositories with many refs.
>
> Signed-off-by: Erik Chen <erikchen@chromium.org>
> ---
>  fetch-pack.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/fetch-pack.c b/fetch-pack.c
> index 0130b44112..f2f3365bbe 100644
> --- a/fetch-pack.c
> +++ b/fetch-pack.c
> @@ -666,9 +666,10 @@ static void mark_complete_and_common_ref(struct fetch_negotiator *negotiator,
>  	struct ref *ref;
>  	int old_save_commit_buffer = save_commit_buffer;
>  	timestamp_t cutoff = 0;
> -

I would keep this empty line. Other than that, this patch looks good to me.

Thanks, Johannes

Show 37 quoted lines
>  	save_commit_buffer = 0;
>
> +	trace2_region_enter("fetch-pack", "mark_complete_and_common_ref", NULL);
> +
>  	for (ref = *refs; ref; ref = ref->next) {
>  		struct object *o;
>
> @@ -690,6 +691,10 @@ static void mark_complete_and_common_ref(struct fetch_negotiator *negotiator,
>  		}
>  	}
>
> +	/* This block marks all local refs as COMPLETE, and then recursively marks all
> +	 * parents of those refs as COMPLETE.
> +	 */
> +	trace2_region_enter("fetch-pack", "mark_complete_local_refs", NULL);
>  	if (!args->deepen) {
>  		for_each_ref(mark_complete_oid, NULL);
>  		for_each_cached_alternate(NULL, mark_alternate_complete);
> @@ -697,6 +702,7 @@ static void mark_complete_and_common_ref(struct fetch_negotiator *negotiator,
>  		if (cutoff)
>  			mark_recent_complete_commits(args, cutoff);
>  	}
> +	trace2_region_leave("fetch-pack", "mark_complete_local_refs", NULL);
>
>  	/*
>  	 * Mark all complete remote refs as common refs.
> @@ -716,6 +722,7 @@ static void mark_complete_and_common_ref(struct fetch_negotiator *negotiator,
>  	}
>
>  	save_commit_buffer = old_save_commit_buffer;
> +	trace2_region_leave("fetch-pack", "mark_complete_and_common_ref", NULL);
>  }
>
>  /*
> --
> gitgitgadget
>
Previous: Erik Chen via GitGitGadgetNext: erik chen via GitGitGadget
Message 3 of 22 in “fetch: add trace2 instrumentation”
  1. 0/1 fetch: add trace2 instrumentationerik chen via GitGitGadget, Nov 5, 2019
  2. 1/1 fetch: add trace2 instrumentationErik Chen via GitGitGadget, Nov 5, 2019
  3. Johannes SchindelinNov 6, 2019
  4. 0/2 fetch: add trace2 instrumentationerik chen via GitGitGadget, Nov 6, 2019
  5. 1/2 fetch: add trace2 instrumentationErik Chen via GitGitGadget, Nov 6, 2019
  6. 2/2 add whitespaceErik Chen via GitGitGadget, Nov 6, 2019
  7. 0/1 fetch: add trace2 instrumentationerik chen via GitGitGadget, Nov 6, 2019
  8. 1/1 fetch: add trace2 instrumentationErik Chen via GitGitGadget, Nov 6, 2019
  9. Junio C HamanoNov 7, 2019
  10. Derrick StoleeNov 18, 2019
  11. Junio C HamanoNov 19, 2019
  12. Erik ChenNov 19, 2019
  13. Erik ChenNov 19, 2019
  14. Erik ChenNov 19, 2019
  15. Erik ChenNov 19, 2019
  16. Junio C HamanoNov 7, 2019
  17. Erik ChenNov 19, 2019
  18. 0/1 fetch: add trace2 instrumentationerik chen via GitGitGadget, Nov 18, 2019
  19. 1/1 fetch: add trace2 instrumentationErik Chen via GitGitGadget, Nov 18, 2019
  20. 0/1 fetch: add trace2 instrumentationerik chen via GitGitGadget, Nov 19, 2019
  21. 1/1 fetch: add trace2 instrumentationErik Chen via GitGitGadget, Nov 19, 2019
  22. Junio C HamanoNov 20, 2019

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.