3 use Benchmark qw/cmpthese/;
6 for my $klass (qw/Moose Mouse/) {
8 package [% klass %]One;
15 __PACKAGE__->meta->make_immutable;
20 print "Class::MOP: $Class::MOP::VERSION\n";
21 print "Moose: $Moose::VERSION\n";
22 print "Mouse: $Mouse::VERSION\n";
26 map { my $x = $_; $_ => sub { $x->new(n => 3) } }
32 print "---- new,set\n";
35 map { my $y = $_; $_ => sub { $y->new(n => 3)->n(5) } }
42 my %c = map { $_ => "${_}One"->new(n => 3) } qw/Moose Mouse/;
45 map { my $y = $_; $_ => sub { $c{$y}->n(5) } }
53 map { my $y = $_; $_ => sub { $c{$y}->n() } }