[racket] generator performance (again)

From: Patrick Useldinger (uselpa.list at gmail.com)
Date: Mon Oct 8 00:32:03 EDT 2012

On 08/10/2012 01:23, Danny Yoo wrote:

> Hmmm!  Looking at it now...  Wait: your definition of fibo-gen2 is not
> exactly equivalent to the others in terms of work when verbose is off.

Good spot! It's consistent now. Generators and delay/force are roughly 
the same speed (although the latter explodes in terms of garbage 
collection), whereas the "ugly" solution outperforms them all (2.5 times 

fibo-clos : cpu time: 5887 real time: 6135 gc time: 716
fibo-gen1 : cpu time: 14572 real time: 15205 gc time: 1707
fibo-gen2 : cpu time: 14540 real time: 15181 gc time: 1709
fibo-delay: cpu time: 14045 real time: 14309 gc time: 8417


Posted on the users mailing list.