- or download this
! /usr/bin/perl -w
...
__END__
produces:
undefined=2, defined=3
- or download this
#! /usr/bin/perl -w
...
grep => ' by_grep( \%h ) ',
}
);
- or download this
by_for: undefined=2000300, defined=7999700
by_grep: undefined=2000300, defined=7999700
...
Rate for grep
for 163521/s -- -27%
grep 224222/s 37% --
- or download this
cmpthese( -300, {
byfor => sub { by_for( \%h ) },
bygrep => sub { by_grep( \%h ) },
}
);
- or download this
by_for: undefined=2398233, defined=9601767
by_grep: undefined=2398233, defined=9601767
...
s/iter bygrep byfor
bygrep 24.1 -- -35%
byfor 15.6 55% --
- or download this
sub by_diff {
my $h = shift;
...
bydiff => sub { by_diff( \%h ) },
}
);
- or download this
by_for: undefined=2398740, defined=9601260
by_grep: undefined=2398740, defined=9601260
...
bygrep 24.1 -- -35% -51%
byfor 15.6 55% -- -24%
bydiff 11.9 103% 31% --