fix "use MyExporter -traits => ..." (RT77974)
[gitmo/Moose.git] / benchmarks / cmop / profile.pl
CommitLineData
38bf2a25 1#!perl -w
2# Usage: perl bench/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', $script );
20print "> @cmd\n";
21system(@cmd) == 0 or die "Cannot profile";
22
23@cmd = ( $^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch" );
24print "> @cmd\n";
25system(@cmd) == 0 or die "Cannot profile";