in reply to Tail Recursion "Optimising" with goto &sub

This is a pretty elaborate way to do it, but it's good to see a demonstration of perl's unapologetic form of goto outside AUTOLOAD subs.

Have you benchmarked this against a straight iterative implementation?

After Compline,
Zaxo

  • Comment on Re: Tail Recursion "Optimising" with goto &sub

Replies are listed 'Best First'.
Re: Re: Tail Recursion "Optimising" with goto &sub
by bsb (Priest) on Feb 21, 2003 at 03:18 UTC
    No, I haven't benchmarked it yet.

    I'm curious about the results vs normal recursion but surely the straight iterative version would be faster.

    Only if you were using a very functional style would this potentially be a useful place to look for speed, but in that case you'd probably want to do it in the compiler/optimizer rather than by hand. (Waffling here...)