From: Dave Rolsky Date: Mon, 25 Apr 2011 00:27:23 +0000 (-0500) Subject: Improve benchmark (don't include object construction in accessor measurement) X-Git-Tag: 2.0100~188 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a965b6da59987429b38cfcb1274d87c57f3f1e8b;p=gitmo%2FMoose.git Improve benchmark (don't include object construction in accessor measurement) --- diff --git a/benchmarks/type_constraints2.pl b/benchmarks/type_constraints2.pl index b00fcbf..688360a 100644 --- a/benchmarks/type_constraints2.pl +++ b/benchmarks/type_constraints2.pl @@ -91,6 +91,8 @@ my %strs = map { $_ => $_ } @ints; my %fhs = map { $_ => $_ } @fhs; my %objects = map { $_ => $_ } @objects; +my $thing = Thing->new; + timethese( 200_00, { constructor => sub { @@ -110,8 +112,6 @@ timethese( ); }, accessors => sub { - my $thing = Thing->new; - $thing->int( $ints[0] ); $thing->str( $strs[0] ); $thing->fh( $fhs[0] );