From: gfx Date: Thu, 3 Dec 2009 03:25:46 +0000 (+0900) Subject: Fix benchmarks/vs_caf.pl X-Git-Tag: 0.40_09~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=57d5cc86637a2ab577bd4071abd967a382c8aa34;p=gitmo%2FMouse.git Fix benchmarks/vs_caf.pl --- diff --git a/benchmarks/vs_caf.pl b/benchmarks/vs_caf.pl index 569b78f..6214e58 100644 --- a/benchmarks/vs_caf.pl +++ b/benchmarks/vs_caf.pl @@ -44,29 +44,9 @@ cmpthese(-1, { ClassAccessorFast => sub { $caf->foo }, }, 'noc'); -my (@moose, @moose_immut, @mouse, @mouse_immut, @caf_stall); -print "\nCREATION\n"; -cmpthese(1_000_000, { - Moose => sub { push @moose, PlainMoose->new(foo => 23) }, - Mouse => sub { push @mouse, PlainMouse->new(foo => 23) }, - ClassAccessorFast => sub { push @caf_stall, ClassAccessorFast->new({foo => 23}) }, -}, 'noc'); - -my ( $moose_idx, $mouse_idx, $caf_idx ) = ( 0, 0, 0, 0 ); -print "\nDESTRUCTION\n"; -cmpthese(1_000_000, { - Moose => sub { - $moose[$moose_idx] = undef; - $moose_idx++; - }, - Mouse => sub { - $mouse[$mouse_idx] = undef; - $mouse_idx++; - }, - ClassAccessorFast => sub { - $caf_stall[$caf_idx] = undef; - $caf_idx++; - }, +print "\nCREATION AND DESTRUCTION\n"; +cmpthese(-1, { + Moose => sub { my $x = PlainMoose->new(foo => 23) }, + Mouse => sub { my $x = PlainMouse->new(foo => 23) }, + ClassAccessorFast => sub { my $x = ClassAccessorFast->new({foo => 23}) }, }, 'noc'); - -