Sorry, I haven't found any time spending on this topic the last days...
Your benchmarks are not exactly what I thought about, what I have in my mind is:
#!/usr/bin/perl --
use Benchmark qw/ cmpthese /;
print "$]\n";
my $what1 = 'WWWA';
my $what2 = $what1;
cmpthese(
-3,
{
circumcised => sub {
$what1 =~ /EB.*Z/; # fail one
$what1 .='DBBBABC';
substr $what1, 0, 8, '';
$what1 =~ /EB.*Z/; # fail another
return;
},
uncut => sub {
$what2 =~ /EB.*Z/; # fail one
$what2 .='DBBBABC';
$what2 =~ /EB.*Z/; # fail another
return;
},
},
);
print "\n\n";
__END__
5.010001
Rate uncut circumcised
uncut 2735/s -- -100%
circumcised 3398892/s 124179% --
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.