Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^5: Who's a thief? (No memory growth with magic goto)by BrowserUk (Patriarch) |
on Jan 14, 2005 at 19:16 UTC ( [id://422350]=note: print w/replies, xml ) | Need Help?? |
If you can arrange your algorithm to be tail recursive, and use the magic form of goto, you can cut the memory growth to zero and achieve some very impressive figures. 8 seconds for 10 million recursions and 83 seconds for 100 million with the memory consumption never over 1.5 MB.
It takes a little effort to do, but when you need it it is worth it. Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.
In Section
Meditations
|
|