use Benchmark(cmpthese); cmpthese(100_000, { 'a' => sub { $_ = 'this that this those this these.'; $a = () = /this/g; }, 'b' => sub { $_ = 'this that this those this these.'; $a++ while(s/this//); } });
wrong?Rate a b a 458716/s -- -7% b 492611/s 7% --
In reply to Re: Count number of occurrence of word
by Lennotoecom
in thread Count number of occurrence of word
by fattahsafa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |