Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use warnings;
- use Benchmark qw( cmpthese );
- use List::Util qw( any );
- my %params;
- my %tests = (
- any => sub { for (1..1000) { my $x = any { !$params{$_} } qw( account type sampledate lastpwchange system wspass ); } },
- grep => sub { for (1..1000) { my $x = grep { !$params{$_} } qw( account type sampledate lastpwchange system wspass ); } },
- );
- cmpthese(-3, \%tests);
- =pod
- Rate any grep
- any 473/s -- -55%
- grep 1055/s 123% --
- =end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement