On Wednesday 26 November 2008 08:48, Carsten Saager wrote:
> Impressive:
>
> user=> (time (trampoline #(foo 1000)) )
> "Elapsed time: 0.547556 msecs"
>
> user=> (time (foo 1000))
> "Elapsed time: 0.375466 msecs"
>
> Looks like the penalty is not that high, but after the JIT kicked in
> the trampolined version takes twice as long as the recusive version -
> hard to call this a TCO when the tail-call takes actually longer.
> ...
The point is not to optimize CPU time, but to keep stack consumption
independent of the input size in mutually recursive sets of function
and to do so using the stock JVM's ordinary call stack.
> /Carsten
>
> On Wed, Nov 26, 2008 at 4:08 PM, James Iry <
jamesiry@...> wrote:
> >
http://groups.google.com/group/clojure/msg/3addf875319c5c10Randall Schulz