4 use Benchmark qw/cmpthese/;
6 for my $klass (qw/Moose Mouse/) {
20 __PACKAGE__->meta->make_immutable;
25 print "Class::MOP: $Class::MOP::VERSION\n";
26 print "Moose: $Moose::VERSION\n";
27 print "Mouse: $Mouse::VERSION\n";
31 map { my $x = $_; $_ => sub { $x->new(n => 3) } }
37 print "---- new,set\n";
40 map { my $y = $_; $_ => sub { $y->new(n => 3)->n(5) } }
47 my %c = map { $_ => "${_}One"->new(n => 3) } qw/Moose Mouse/;
50 map { my $y = $_; $_ => sub { $c{$y}->n(5) } }
58 map { my $y = $_; $_ => sub { $c{$y}->n() } }