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

Re: Autogenerate descending arrays

by bl0rf (Pilgrim)
on Mar 14, 2004 at 21:52 UTC ( #336544=note: print w/ replies, xml ) Need Help??

in reply to Autogenerate descending arrays

aah! I completely forgot about reverse!
Thank you fellow monks for your feedback, testing also shows that reverse is twice as fast as my method. I'm happy there's more than one way to do it ( or anything ).

Comment on Re: Autogenerate descending arrays
Replies are listed 'Best First'.
Re: Re: Autogenerate descending arrays
by kappa (Chaplain) on Mar 14, 2004 at 22:08 UTC
    By the way, using reverse is faster because this case is optimized as the action mentioned in the subject is very common :)
      How is it optimized?
        I stand corrected. Looks like foreach (reverse 1 .. 1000000) still generates a huge temporary list.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2015-11-28 11:52 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (741 votes), past polls