--- /dev/null
+#!perl
+# a moose using script for profiling
+# Usage: perl bench/profile.pl
+
+package Foo;
+use Moose;
+
+has aaa => (
+ is => 'rw',
+ isa => 'Str',
+);
+
+has bbb => (
+ is => 'rw',
+ isa => 'Str',
+);
+
+has ccc => (
+ is => 'rw',
+ isa => 'Str',
+);
+
+has ddd => (
+ is => 'rw',
+ isa => 'Str',
+);
+
+has eee => (
+ is => 'rw',
+ isa => 'Str',
+);
+
+__PACKAGE__->meta->make_immutable();
+
+
+package Bar;
+use Moose;
+
+extends 'Foo';
+
+has xaaa => (
+ is => 'rw',
+ isa => 'Str',
+);
+
+has xbbb => (
+ is => 'rw',
+ isa => 'Str',
+);
+
+has xccc => (
+ is => 'rw',
+ isa => 'Str',
+);
+
+has xddd => (
+ is => 'rw',
+ isa => 'Str',
+);
+
+has xeee => (
+ is => 'rw',
+ isa => 'Str',
+);
+
+__PACKAGE__->meta->make_immutable();
--- /dev/null
+#!perl -w
+# Usage: perl bench/profile.pl (no other options including -Mblib are reqired)
+
+use strict;
+
+my $script = 'bench/foo.pl';
+
+my $branch = do{
+ open my $in, '.git/HEAD' or die "Cannot open .git/HEAD: $!";
+ my $s = scalar <$in>;
+ chomp $s;
+ $s =~ s{^ref: \s+ refs/heads/}{}xms;
+ $s =~ s{/}{_}xmsg;
+ $s;
+};
+
+print "Profiling $branch ...\n";
+
+my @cmd = ($^X, '-Iblib/lib', '-Iblib/arch', $script);
+print "> @cmd\n";
+system(@cmd) == 0 or die "Cannot profile";
+
+@cmd = ($^X, '-S', 'nytprofhtml', '--out', "nytprof-$branch");
+print "> @cmd\n";
+system(@cmd) == 0 or die "Cannot profile";