Unfortunately, I don't have your shiny Benchmark::Sized (I'm looking forward to its release), but there are my results using Benchmark::cmpthese:
Maybe this is because you used \Z, which is equivalent to $ if /s is not used. \z should be used (explained elsewhere in this thread).2;130 juerd@ouranos:~/modje/Blah/Acme/Tie/Handle/Blah/Acme-Tie-Handle- +Blah--0.10$ perl -MBenchmark=cmpthese -e'$_="fooooo"; cmpthese(-1, {r +e => sub {$a = !/^\.\.?\z/}, ne => sub { $a = ($_ ne "." and $_ ne ". +."); }})' Benchmark: running ne, re, each for at least 1 CPU seconds... ne: 1 wallclock secs ( 1.02 usr + -0.01 sys = 1.01 CPU) @ 12 +18808.91/s (n=1230997) re: 1 wallclock secs ( 1.09 usr + 0.00 sys = 1.09 CPU) @ 18 +03743.12/s (n=1966080) Rate ne re ne 1218809/s -- -32% re 1803743/s 48% --
2;0 juerd@ouranos:~/modje/Blah/Acme/Tie/Handle/Blah/Acme-Tie-Handle-Bl +ah--0.10$ perl -MBenchmark=cmpthese -e'$_="foo"; cmpthese(-0.3, { z = +> sub { /o\z/ }, Z => sub { /o\Z/ } });' Benchmark: running Z, z, each for at least 0.3 CPU seconds... Z: 2 wallclock secs ( 0.43 usr + 0.02 sys = 0.45 CPU) @ 36 +70015.56/s (n=1651507) z: 1 wallclock secs ( 0.44 usr + -0.01 sys = 0.43 CPU) @ 44 +19869.77/s (n=1900544) Rate Z z Z 3670016/s -- -17% z 4419870/s 20% --
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
In reply to Re: Re: Create a list of directories without . and ..
by Juerd
in thread Create a list of directories without . and ..
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |