This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Recursive vs. tail-recursive functions


On Wed, Jun 07, 2000 at 11:18:05PM -0700, Andrew Ho wrote:

> The strange result seems to be that the simple recursive case is
> significantly faster than the tail-recursive case. 

Especially when the simple recursive case runs out of stack. :-)

I'd be interested to know why this is, too, but the reason for
re-writing these list operations tail-recursively is to avoid
overflowing the stack, not for performance.  (I discovered that
they weren't tail-recursive not by a thorough examination of the
source, nor because my program seemed suspiciously slow, but
because by program finished inappropriately quickly.)

Regards,

William

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]