in reply to Re: catching infinite loops
in thread catching infinite loops
In Perl deep recursion leaks a lot of memory and is a lot slower than you would ever suspect. These two facts are connected.
I have not tested with the current version, but also note that tail recursion with goto &my_sub does not get the performance you would hope for with a long argument list (there is adjusting of the stack), and appears to have a memory leak somewhere.
Don't let this scare you off of recursion as a technique, but do be aware that you don't just want to blindly turn iterative loops into recursion.
|
|---|