X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=author%2Fbenchmarks%2Fbasic.pl;h=47873d8d3423a72d2d32e4ac2c7eddec0014a004;hb=f152b0997e523b60b2dbcefff8d102fc1096bf49;hp=bdc3de7552d0ce4969d595d43c230ef5da128445;hpb=cbf062fa0f20e0b123853e68838693e74ae8f35e;p=gitmo%2FMouse.git diff --git a/author/benchmarks/basic.pl b/author/benchmarks/basic.pl index bdc3de7..47873d8 100644 --- a/author/benchmarks/basic.pl +++ b/author/benchmarks/basic.pl @@ -37,3 +37,21 @@ cmpthese( qw/Moose Mouse/ } ); + +print "---- set\n"; +my %c = map { $_ => "${_}One"->new(n => 3) } qw/Moose Mouse/; +cmpthese( + 100000 => { + map { my $y = $_; $_ => sub { $c{$y}->n(5) } } + qw/Moose Mouse/ + } +); + +print "---- get\n"; +cmpthese( + 0 => { + map { my $y = $_; $_ => sub { $c{$y}->n() } } + qw/Moose Mouse/ + } +); +