Help for this page
#!/usr/bin/perl -w use strict; ... cmpthese(-3,{ 'Ref' => sub { my $a=returnhashref(); return $$a{245}}, 'newhash' => sub { my $a=returnhashref(); my %a = %$a; return +$a{245}}});
Benchmark: running Ref, newhash, each for at least 3 CPU seconds... Ref: 3 wallclock secs ( 3.24 usr + 0.01 sys = 3.25 CPU) @ 38 +1.54/s (n=1240) ... Rate newhash Ref newhash 212/s -- -44% Ref 382/s 80% --