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

Re: [PATCH] improve git svn performance

From
EWEric Wong <normalperson@yhbt.net>
Date
Jan 22, 2014, 02:56 UTC
Message-ID
<20140122025630.GA15886@dcvr.yhbt.net>
In-Reply-To
<1390192672-3827-1-git-send-email-manjian2006@gmail.com>
manjian2006@gmail.com wrote:
Show 6 quoted lines
> From: linzj <linzj@ucweb.com>
>   I am trying to improve git svn's performance according to some
>   profiling data.As the data showed,_rev_list subroutine and rebuild
>   subroutine are consuming a large proportion of time.So I improve
>   _rev_list's performance by memoize its results,and avoid subprocess
>   invocation by memoize rebuild subroutine's key data.Here's my patch:

Hi, I'm interested in this. How much did performance improve by (and how many revisions is the repository)>

However, I cannot accept the patch in the current state.

The commit message is inadequate; and you need a Signed-off-by and follow existing coding convention/style. See Documentation/SubmittingPatches and Documentation/CodingGuidelines for more info.

Some comments inline...
Show 10 quoted lines
>  		tie_for_persistent_memoization(\%lookup_svn_merge_cache,
> -		    "$cache_path/lookup_svn_merge");
> +				"$cache_path/lookup_svn_merge");
>  		memoize 'lookup_svn_merge',
> -			SCALAR_CACHE => 'FAULT',
> -			LIST_CACHE => ['HASH' => \%lookup_svn_merge_cache],
> -		;
> +				SCALAR_CACHE => 'FAULT',
> +				LIST_CACHE => ['HASH' => \%lookup_svn_merge_cache],
> +				;
Please no extraneous whitespace changes.
> +#define a global associate map to record rebuild status
> +my %rebuildStatus;
We prefer snake_case variables, not camelCase.
Show 15 quoted lines
>  sub rebuild {
>  	my ($self) = @_;
>  	my $map_path = $self->map_path;
>  	my $partial = (-e $map_path && ! -z $map_path);
> -	return unless ::verify_ref($self->refname.'^0');
> +    my $verifyKey = $self->refname.'^0';
> +    if (! exists $rebuildVerifyStatus{$verifyKey} || ! defined $rebuildVerifyStatus{$verifyKey} ) {
> +        my $verifyResult = ::verify_ref($verifyKey);
> +        if ($verifyResult) {
> +            $rebuildVerifyStatus{$verifyKey} = 1;
> +        }
> +    }
> +    if (! exists $rebuildVerifyStatus{$verifyKey}) {
> +        return;
> +    }

Please use tabs for indentation to match surrounding code (most of git is tabs).

Thanks.
Previous: manjian2006@gmail.com
Message 2 of 2 in “improve git svn performance”
  1. improve git svn performancemanjian2006@gmail.com, Jan 20, 2014
  2. Eric WongJan 22, 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.