Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Dreaming in Perl

by theorbtwo (Prior)
on Dec 02, 2002 at 11:38 UTC ( #216886=note: print w/ replies, xml ) Need Help??


in reply to Dreaming in Perl

To answer your question, the first and third will probably be about the same speed. The second will be significantly slower (lots of memory), and the fourth will be obscenly complicated. If it's much slower or about the same (or even faster!) depends mostly on how (explicitly) parallel your brain is.

theorbtwo can't sleep either, but wasn't dreaming of code... as far as he remembers.


Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).


Comment on Re: Dreaming in Perl
Re^2: Dreaming in Perl
by Aristotle (Chancellor) on Dec 02, 2002 at 23:41 UTC

    I'm too lazy to benchmark, but since I know for(;;) is implemented in terms of while(){} continue{} and am fairly certain the list for the foreach is generated lazily in Perl5 (and thus juggling memory is not an issue), I'll hazard a guess that #3 should be the be the fastest of the lot.

    FWIW, I don't remember ever dreaming of code. Then again, I rarely ever remember anything but the worst of anxiety ridden dreams, so I may well have. Who knows?

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://216886]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-12-19 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (69 votes), past polls