Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re:x2 Counting keys with defined or undefined elements in a hash

by sauoq (Abbot)
on Jun 05, 2003 at 19:19 UTC ( [id://263471] : note . print w/replies, xml ) Need Help??


in reply to Re:x2 Counting keys with defined or undefined elements in a hash
in thread Counting keys with defined or undefined elements in a hash

Still, iterating over a 10_000_000 element list more than 160 thousand times a second isn't too shabby a performance...

In fact, it's not shabby enough. That sort of speed should have made you take another look at your benchmark.

Try changing your cmpthese() call to

cmpthese( -5, { for => sub { by_for(\%h) }, grep => sub { by_grep(\%h) }, } );

-sauoq
"My two cents aren't worth a dime.";
  • Comment on Re: Re:x2 Counting keys with defined or undefined elements in a hash
  • Download Code