in reply to A mod2 Machine.

One comment: Your benchmark is broken:

$MAX=1e7; cmpthese -1, { a => q[ my $c = 0; $_%2 and ++$c for 0 .. $MAX; print "a:$c" ], b => q[ my $c = 0; $_ =~ m[[02468]$] or ++$c for 0 .. $MAX; print "b:$c" ] };; a:5000000 a:5000000 b:5000000 b:5000000 s/iter b a b 3.50 -- -64% a 1.27 177% -- $MAX=1e8; cmpthese -1, { a => q[my $c = 0; $_%2 and ++$c for 0 .. $MAX; print "a:$c" ], b => q[ my $c = 0; $_=~ m[[02468]$] or ++$c for 0 .. $MAX; print " +b:$c" ] };; a:50000000 a:50000000 b:50000000 b:50000000 s/iter b a b 34.3 -- -64% a 12.3 179% --

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: A mod2 Machine.
Download Code