From: Tokuhiro Matsuno Date: Thu, 2 Apr 2009 04:04:29 +0000 (+0900) Subject: added benchmark case for setter, getter X-Git-Tag: 0.20~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=b7e3d8b3fd28bcf7a947ecf1890a695137430744 added benchmark case for setter, getter --- 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/ + } +); +