[plt-scheme] List loop timing

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Fri Feb 15 13:40:27 EST 2008

On Fri, Feb 15, 2008 at 1:00 PM, Prabhakar Ragde <plragde at uwaterloo.ca> wrote:
> Carl Eastlund wrote:
>  > I could write the accumulator-reverse, the normally tail
>  > recursive one, and defeat the tail recursion with an assertion after
>  > the fact, and probably still get results almost as fast as the
>  > tail-recursive version.
>  Sure, but it wouldn't be faster. And I don't see a "natural" way to
>  write a fast non-tail-recursive reverse.

I'm not claiming it's faster.  You claimed, earlier, that tail
recursion occasionally does something for time, and used reverse as an
example.  My point is that removing append is what did something for
its time, and tail recursion was serendipitous.  The saved time is all
due to traversal of the list structure, and not due to the stack.

Carl Eastlund

Posted on the users mailing list.