in reply to ForkManager Running Real Slow

So, lemme get this right ... If I need to dig a hole, and have "n" spades available - you guys are the people to talk to about how fast I could dig half a hole...... with half as many, or twice as many spades as I have miners (ignoring elevator rides up or down to the coal-face).

But if I need to run a million very short lived calculations, then I shouldn't be so dumb as to thinks that the time saves spawning and reaping processes would help performance any...

Just as well you don't charge by the analogy, isn't it!

Thanks

Replies are listed 'Best First'.
Re^2: ForkManager Running Real Slow
by BrowserUk (Patriarch) on Sep 04, 2009 at 18:09 UTC
    Just as well you don't charge by the analogy, isn't it!

    No analogy. Just the facts:

    use Time::HiRes qw[ time ];; $start = time; scoring() for 1 .. 1e6; printf "Took: %.15f / iteration\n", ( time() - $start ) / 1e6;; Took: 0.000000280799866 / iteration $start = time; async{ return 1 }->join for 1.. 10; printf "took: %.15f / iteration\n", ( time() - $start ) / 10;; took: 0.011679911613464 / iteration print 0.011679911613464 / 0.000000280799866;; 41595.1466781113

    Seems I under-estimated the differential a tad.


    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.