Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Dreaming in Perl

by theorbtwo (Prior)
on Dec 02, 2002 at 11:38 UTC ( [id://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).

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://216886]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-25 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found