[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: High run time variance
From: |
Ludovic Courtès |
Subject: |
Re: High run time variance |
Date: |
Tue, 30 Mar 2010 11:16:05 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Hi Luca,
Luca Saiu <address@hidden> 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’.