2 # Usage: perl bench/profile.pl (no other options including -Mblib are reqired)
6 my $script = 'bench/foo.pl';
9 open my $in, '.git/HEAD' or die "Cannot open .git/HEAD: $!";
12 $s =~ s{^ref: \s+ refs/heads/}{}xms;
17 print "Profiling $branch ...\n";
19 my @cmd = ( $^X, '-Iblib/lib', '-Iblib/arch', $script );
21 system(@cmd) == 0 or die "Cannot profile";
23 @cmd = ( $^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch" );
25 system(@cmd) == 0 or die "Cannot profile";