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;
},
};
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";