Commit | Line | Data |
834fbe12 |
1 | #!perl -w |
2 | # Usage: perl author/profile.pl (no other options including -Mblib are reqired) |
3 | |
4 | use strict; |
5 | |
e3575663 |
6 | my $script = 'author/use-he.pl'; |
834fbe12 |
7 | |
8 | my $branch = do{ |
e3575663 |
9 | if(open my $in, '.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 | else{ |
17 | require 'lib/Mouse/Spec.pm'; |
18 | Mouse::Spec->VERSION; |
19 | } |
834fbe12 |
20 | }; |
21 | |
22 | print "Profiling $branch ...\n"; |
23 | |
e3575663 |
24 | my @cmd = ($^X, '-Iblib/lib', '-Iblib/arch', '-d:NYTProf', $script); |
834fbe12 |
25 | |
26 | print "> @cmd\n"; |
27 | system(@cmd) == 0 or die "Cannot profile"; |
28 | system(@cmd) == 0 or die "Cannot profile"; |
29 | system(@cmd) == 0 or die "Cannot profile"; |
30 | |
31 | @cmd = ($^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch"); |
32 | print "> @cmd\n"; |
33 | system(@cmd) == 0 or die "Cannot profile"; |