[plt-scheme] fibonacci number in Scheme and Ruby

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Apr 21 12:12:09 EDT 2004

At Tue, 20 Apr 2004 20:38:14 +0200, Manfred Lotz wrote:
> What baffles me is that the Ruby version is so much faster than the
> Scheme version.

I think it's mostly a question of how the GC is tuned. In your run,
MzScheme spent 75% of its time GCing.

When I run on a 733 MHz PPC with OS X, I see the same factor of 4. But
Ruby starts at 1.2 MB and grows to 10.6 MB. MzScheme starts at 3 MB and
grows to 3.6 MB.

I don't know how to tune MzScheme's default collector to make it use 10
MB. (The options seem to be 5 MB and infinity.) If I use MzScheme3m,
the default tuning makes it run the example in half the time of plain
MzScheme, and using up to 6 MB. I can tune 3m to use 10 MB for the
example, in which case it runs only slightly slower than Ruby (slower
by 10% instead of 300%).


Posted on the users mailing list.