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.
In reply to Re (tilly) 2: catching infinite loops
by tilly
in thread catching infinite loops
by cLive ;-)
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |