Problems? Is your data what you think it is? | |
PerlMonks |
Re^3: counting backward (optimize foreach reverse low .. highby BrowserUk (Patriarch) |
on Mar 02, 2013 at 15:29 UTC ( [id://1021430]=note: print w/replies, xml ) | Need Help?? |
But you still had to create a huge array in order to benefit from the optimisation; which kinda negates the purpose. This: perl -E"@a=1..1e9; for( reverse @a ) { print $_; <> }" consumes 18GB (that's Gigabytes!) of memory Whereas this: perl -E"for( -1e9..1 ) { print -$_; <> }" iterates the same range and consumes only 1.8MB of ram. Four orders of magnitude more memory, or a minus sign. My choice is simple; how about yours? With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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.
In Section
Seekers of Perl Wisdom
|
|