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

RE: [PATCH] subtree: performance improvement for finding unexpected parent commits

From
Strain, Roger L. <roger.strain@swri.org>
Date
Oct 12, 2018, 13:55 UTC
Message-ID
<b4163622de7442849e7f3f118db0c0ea@MBX260.adm.swri.edu>
In-Reply-To
<20181012135218.14439-1-rstrain@swri.org>
Original failed to include the note that this patch is for the 'next' branch, my apologies.
Show 37 quoted lines
> -----Original Message-----
> From: Roger Strain <rstrain@swri.org>
> Sent: Friday, October 12, 2018 8:52 AM
> To: git@vger.kernel.org
> Cc: Strain, Roger L. <roger.strain@swri.org>
> Subject: [PATCH] subtree: performance improvement for finding
> unexpected parent commits
> 
> After testing a previous patch at larger scale, a performance issue was
> detected when using git show to locate parent revisions, with a single run of
> the git show command taking 2 seconds or longer in a complex repo.
> When the command is required tens or hundreds of times in a run of the
> script, the additional wait time is unaccepatable. Replacing the command
> with git rev-parse resulted in significantly increased performance, with the
> command in question returning instantly.
> 
> Signed-off-by: Roger Strain <rstrain@swri.org>
> Thanks-to: Junio C Hamano <gitster@pobox.com>
> ---
>  contrib/subtree/git-subtree.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
> index 1c157dbd9..147201dc6 100755
> --- a/contrib/subtree/git-subtree.sh
> +++ b/contrib/subtree/git-subtree.sh
> @@ -633,7 +633,7 @@ process_split_commit () {
>  	else
>  		# processing commit without normal parent information;
>  		# fetch from repo
> -		parents=$(git show -s --pretty=%P "$rev")
> +		parents=$(git rev-parse "$rev^@")
>  		extracount=$(($extracount + 1))
>  	fi
> 
> --
> 2.19.1
Previous: Roger StrainNext: Junio C Hamano
Message 2 of 3 in “subtree: performance improvement for finding unexpected parent commits”
  1. subtree: performance improvement for finding unexpected parent commitsRoger Strain, Oct 12, 2018
  2. Strain, Roger L.Oct 12, 2018
  3. Junio C HamanoOct 12, 2018

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.