Include method name in immutable methods (fixes #49680)
[gitmo/Class-MOP.git] / bench / profile.pl
CommitLineData
26b2e5ab 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
78d1cea6 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;
26b2e5ab 15};
16
17print "Profiling $branch ...\n";
18
78d1cea6 19my @cmd = ( $^X, '-Iblib/lib', '-Iblib/arch', $script );
26b2e5ab 20print "> @cmd\n";
21system(@cmd) == 0 or die "Cannot profile";
22
78d1cea6 23@cmd = ( $^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch" );
26b2e5ab 24print "> @cmd\n";
25system(@cmd) == 0 or die "Cannot profile";