Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Uggh; horrible inner loop screwing up all performance :-(

This might actually make the redis version unnecessary for most people!
And if it does, well shame on me for not instrumenting things at a more
granular level before going all "oh we need a cache!"

[In my defense, I blame redis for being such a sweet little tool that I
felt compelled to use it somehow!]

----

t/sequence failed because the test itself was in error; fixed.
  • Loading branch information...
commit d3d93961a082c286d3f205d310c78079ebc3256f 1 parent 1f96180
Sitaram Chamarty authored November 14, 2012
7  src/lib/Gitolite/Conf/Load.pm
@@ -32,6 +32,7 @@ our $data_version = '';
32 32
 our %repos;
33 33
 our %one_repo;
34 34
 our %groups;
  35
+our %patterns;
35 36
 our %configs;
36 37
 our %one_config;
37 38
 our %split_conf;
@@ -326,8 +327,10 @@ sub memberships {
326 327
         }
327 328
     }
328 329
 
329  
-    for my $i ( keys %groups ) {
330  
-        if ( $base eq $i or $base =~ /^$i$/ or $base2 and ( $base2 eq $i or $base2 =~ /^$i$/ ) ) {
  330
+    push @ret, @{ $groups{$base} } if exists $groups{$base};
  331
+    push @ret, @{ $groups{$base2} } if $base2 and exists $groups{$base2};
  332
+    for my $i ( keys %{ $patterns{groups} } ) {
  333
+        if ( $base =~ /^$i$/ or $base2 and ( $base2 =~ /^$i$/ ) ) {
331 334
             push @ret, @{ $groups{$i} };
332 335
         }
333 336
     }
12  src/lib/Gitolite/Conf/Store.pm
@@ -288,6 +288,8 @@ sub store_common {
288 288
     my $cc = "conf/gitolite.conf-compiled.pm";
289 289
     my $compiled_fh = _open( ">", "$cc.new" );
290 290
 
  291
+    my %patterns = ();
  292
+
291 293
     my $data_version = glrc('current-data-version');
292 294
     trace( 3, "data_version = $data_version" );
293 295
     print $compiled_fh Data::Dumper->Dump( [$data_version], [qw(*data_version)] );
@@ -301,7 +303,17 @@ sub store_common {
301 303
         my %groups = %{ inside_out( \%groups ) };
302 304
         $dumped_data = Data::Dumper->Dump( [ \%groups ], [qw(*groups)] );
303 305
         print $compiled_fh $dumped_data;
  306
+
  307
+        # save patterns in %groups for faster handling of multiple repos, such
  308
+        # as happens in the various POST_COMPILE scripts
  309
+        for my $k (keys %groups) {
  310
+            $patterns{groups}{$k} = 1 unless $k =~ $REPONAME_PATT;
  311
+        }
304 312
     }
  313
+
  314
+    $dumped_data = Data::Dumper->Dump( [ \%patterns ], [qw(*patterns)] ) if %patterns;
  315
+    print $compiled_fh $dumped_data;
  316
+
305 317
     print $compiled_fh Data::Dumper->Dump( [ \%split_conf ], [qw(*split_conf)] ) if %split_conf;
306 318
 
307 319
     close $compiled_fh or _die "close compiled-conf failed: $!\n";
2  src/lib/Gitolite/Rc.pm
@@ -58,7 +58,7 @@ $UNSAFE_PATT          = qr([`~#\$\&()|;<>]);
58 58
 
59 59
 # find the rc file and 'do' it
60 60
 # ----------------------------------------------------------------------
61  
-my $current_data_version = "3.0";
  61
+my $current_data_version = "3.2";
62 62
 
63 63
 my $rc = glrc('filename');
64 64
 if (-r $rc and -s $rc) {
2  t/sequence.t
@@ -55,7 +55,7 @@ try "
55 55
 
56 56
 confreset;confadd '
57 57
     @staff = u1 u2 u3
58  
-    @gfoo = foo/CREATOR/.+
  58
+    @gfoo = foo/CREATOR/..*
59 59
     repo  @gfoo
60 60
           C       = u1
61 61
           RW+     = CREATOR

0 notes on commit d3d9396

Please sign in to comment.
Something went wrong with that request. Please try again.