From: Dave Rolsky Date: Sun, 13 Sep 2009 16:00:35 +0000 (-0500) Subject: tidy benchmark code X-Git-Tag: 0.93~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=78d1cea687a12ba4ccfe4235ec0d764d793cdc5e;p=gitmo%2FClass-MOP.git tidy benchmark code --- diff --git a/bench/loading-benchmark.pl b/bench/loading-benchmark.pl index dc0184c..612ae63 100755 --- a/bench/loading-benchmark.pl +++ b/bench/loading-benchmark.pl @@ -2,25 +2,26 @@ use strict; use Benchmark qw(:all); -my($count, $module) = @ARGV; +my ( $count, $module ) = @ARGV; $count ||= 10; $module ||= 'Moose'; -my @blib = qw(-Iblib/lib -Iblib/arch -I../Moose/blib/lib -I../Moose/blib/arch -I../Moose/lib); +my @blib + = qw(-Iblib/lib -Iblib/arch -I../Moose/blib/lib -I../Moose/blib/arch -I../Moose/lib); -$| = 1; # autoflush +$| = 1; # autoflush print 'Installed: '; -system $^X, '-le', 'require Moose; print $INC{q{Moose.pm}}'; +system $^X, '-le', 'require Moose; print $INC{q{Moose.pm}}'; print 'Blead: '; system $^X, @blib, '-le', 'require Moose; print $INC{q{Moose.pm}}'; cmpthese timethese $count => { released => sub { - system( $^X, '-e', "require $module") == 0 or die; + system( $^X, '-e', "require $module" ) == 0 or die; }, blead => sub { - system( $^X, @blib, '-e', "require $module") == 0 or die; + system( $^X, @blib, '-e', "require $module" ) == 0 or die; }, }; diff --git a/bench/profile.pl b/bench/profile.pl index c4ffc6f..4ea5b01 100755 --- a/bench/profile.pl +++ b/bench/profile.pl @@ -5,21 +5,21 @@ use strict; my $script = 'bench/foo.pl'; -my $branch = do{ - open my $in, '.git/HEAD' or die "Cannot open .git/HEAD: $!"; - my $s = scalar <$in>; - chomp $s; - $s =~ s{^ref: \s+ refs/heads/}{}xms; - $s =~ s{/}{_}xmsg; - $s; +my $branch = do { + open my $in, '.git/HEAD' or die "Cannot open .git/HEAD: $!"; + my $s = scalar <$in>; + chomp $s; + $s =~ s{^ref: \s+ refs/heads/}{}xms; + $s =~ s{/}{_}xmsg; + $s; }; print "Profiling $branch ...\n"; -my @cmd = ($^X, '-Iblib/lib', '-Iblib/arch', $script); +my @cmd = ( $^X, '-Iblib/lib', '-Iblib/arch', $script ); print "> @cmd\n"; system(@cmd) == 0 or die "Cannot profile"; -@cmd = ($^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch"); +@cmd = ( $^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch" ); print "> @cmd\n"; system(@cmd) == 0 or die "Cannot profile";