Fix test-external.pl
[gitmo/Mouse.git] / author / he-profile.pl
CommitLineData
834fbe12 1#!perl -w
2# Usage: perl author/profile.pl (no other options including -Mblib are reqired)
3
4use strict;
5
6my $script = 'bench/foo.pl';
7
8my $branch = do{
9 open my $in, '.git/HEAD' or die "Cannot open .git/HEAD: $!";
10 my $s = scalar <$in>;
11 chomp $s;
12 $s =~ s{^ref: \s+ refs/heads/}{}xms;
13 $s =~ s{/}{_}xmsg;
14 $s;
15};
16
17print "Profiling $branch ...\n";
18
19my @cmd = ($^X, '-Iblib/lib', '-Iblib/arch', '-d:NYTProf', '-e',
20 'require HTTP::Engine; require HTTP::Engine::Interface::CGI');
21
22print "> @cmd\n";
23system(@cmd) == 0 or die "Cannot profile";
24system(@cmd) == 0 or die "Cannot profile";
25system(@cmd) == 0 or die "Cannot profile";
26
27@cmd = ($^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch");
28print "> @cmd\n";
29system(@cmd) == 0 or die "Cannot profile";