X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=samples%2Fbench.pl;h=9b0f1735c5495155bae27be43c01254d36f751fe;hb=3155da47060f2857adc99346d5803837d8ee0376;hp=bb55856e5ca1b898e7ef351de1a07cdd2ec0294b;hpb=163db83e6bed822438bd543d29a1a2b18d0062ba;p=perl%2Fmodules%2Fautovivification.git diff --git a/samples/bench.pl b/samples/bench.pl index bb55856..9b0f173 100644 --- a/samples/bench.pl +++ b/samples/bench.pl @@ -5,6 +5,8 @@ use warnings; use Benchmark qw/cmpthese/; +use blib; + my $count = -1; { @@ -46,3 +48,12 @@ my $count = -1; fetch_hashref_nonexisting_noav => sub { no autovivification; $x->{a} }, }; } + +{ + my $x = { a => { b => { c => { d => 1 } } } }; + + cmpthese $count, { + fetch_hashref4_existing_av => sub { $x->{a}{b}{c}{d} }, + fetch_hashref4_existing_noav => sub { no autovivification; $x->{a}{b}{c}{d} }, + }; +}