in reply to Re^7: &1 is no faster than %2 when checking for oddness. (Careful what you benchmark)
in thread &1 is no faster than %2 when checking for oddness. Oh well.

Whomever takes a look at this should also consider the effects of task switching:

cmpthese 1e6, { a=>q[ $_ = sleep 0 ], b=>q[ $_ = time() ] };; (warning: too few iterations for a reliable count) Rate a b a 533333/s -- -90% b 5347594/s 903% --

Of course this is not a great test, but it does server to maximise the effect of relinguished timeslices on the overall timings.

I've look at Benchmark a few times to see if I could see how to improve it, but it's not easy to find a generic solution. I've found that it is easier to work around it's limitations than fix them.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^8: &1 is no faster than %2 when checking for oddness. (Careful what you benchmark)
  • Download Code