POV-Ray : Newsgroups : povray.general : Recursion in POV : Re: Recursion in POV Server Time
31 Jul 2024 12:16:05 EDT (-0400)
  Re: Recursion in POV  
From: Christian Froeschlin
Date: 16 Mar 2007 18:22:22
Message: <45fb26ae$1@news.povray.org>
Anthony D. Baye wrote:

> In programming, at least for complex cases, recursion can 
> be MUCH faster than a standard loop. 

Recursion is a simple and elegant way to implement some algorithms,
and the most natural way to think about some problems, but I don't
know where you got the notion that it is faster. At best, it will
have similar performance to its unrolled iterative version.

Furthermore, recursion is only really useful when each step recurses
into multiple branches of execution. Even if you only have a branch
factor of 2, a recursion level of 96 ends up in 2^96 leafs, which
is a rather large number. So, this should not be a practical limit ;)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.