2 # Usage: perl author/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', '-d:NYTProf', '-e',
20 'require HTTP::Engine; require HTTP::Engine::Interface::CGI');
23 system(@cmd) == 0 or die "Cannot profile";
24 system(@cmd) == 0 or die "Cannot profile";
25 system(@cmd) == 0 or die "Cannot profile";
27 @cmd = ($^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch");
29 system(@cmd) == 0 or die "Cannot profile";