Comment out install_headers() for merging
[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)
26b2e5ab 3use strict;
4
26b2e5ab 5my $branch = do{
6 open my $in, '.git/HEAD' or die "Cannot open .git/HEAD: $!";
7 my $s = scalar <$in>;
8 chomp $s;
9 $s =~ s{^ref: \s+ refs/heads/}{}xms;
10 $s =~ s{/}{_}xmsg;
11 $s;
12};
13
c6bdbe97 14my $extra = shift || 'KiokuDB';
15
16print "Profiling $branch (require $extra) ...\n";
26b2e5ab 17
3470f68a 18my @cmd = ($^X, '-Iblib/lib', '-Iblib/arch', '-d:NYTProf', '-e', "require Moose; require $extra");
26b2e5ab 19print "> @cmd\n";
20system(@cmd) == 0 or die "Cannot profile";
c6bdbe97 21system(@cmd) == 0 or die "Cannot profile";
22system(@cmd) == 0 or die "Cannot profile";
26b2e5ab 23
24@cmd = ($^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch");
25print "> @cmd\n";
26system(@cmd) == 0 or die "Cannot profile";