Re: [PATCH] improve git svn performance
- From
- Eric 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.