2 # Usage: perl bench/profile.pl (no other options including -Mblib are reqired)
6 open my $in, '.git/HEAD' or die "Cannot open .git/HEAD: $!";
9 $s =~ s{^ref: \s+ refs/heads/}{}xms;
14 my $extra = shift || 'KiokuDB';
16 print "Profiling $branch (require $extra) ...\n";
18 my @cmd = ($^X, '-Iblib/lib', '-Iblib/arch', '-d:NYTProf', '-e', "require Moose; require $extra");
20 system(@cmd) == 0 or die "Cannot profile";
21 system(@cmd) == 0 or die "Cannot profile";
22 system(@cmd) == 0 or die "Cannot profile";
24 @cmd = ($^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch");
26 system(@cmd) == 0 or die "Cannot profile";