Hi Luca,

Luca Saiu <posit...@gnu.org> writes:

> (define (fibo n)
>   (if (< n 2)
>       n
>       (+ (fibo (- n 1))
>          (fibo (- n 2)))))

This function is not tail-recursive, so it consumes stack space, which
increases the amount of memory the GC has to scan.  My guess is that
this has to do with the time spent in GC.

Could you try with a tail-recursive version?

Thanks,
Ludo’.


Reply via email to