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.
|
|---|