<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body alink="#ee0000" bgcolor="#ffffff" link="#0000ee" text="#ffffff"
vlink="#551a8b">
<font color="#000066">I was actually benchmarking DrScheme against
another flavor of Scheme, and I thought the results were unfair, since
DrScheme is also an IDE. So I compiled to .zo (which didn't alter the
times appreciably) and ran this little powerset routine in DrScheme and
MzScheme with the following results.<br>
-------------- THE CODE --------------<br>
(module powerset mzscheme <br>
(provide go)<br>
(define (power-set s) <br>
(if (null? s) <br>
(list '()) <br>
(let ((rest (power-set (cdr s)))) <br>
(append (map (lambda(x) (cons (car s) x)) rest) rest)))) <br>
(define (go)<br>
(collect-garbage)<br>
(time<br>
(let ([ps (power-set '(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
19 20))])<br>
'powerset)))<br>
)<br>
-------------- THE RESULTS ------------<br>
Welcome to DrScheme, version 369.8-svn2mar2007 [3m].<br>
Language: Textual (MzScheme, includes R5RS).<br>
> (require powerset)<br>
> (go)<br>
cpu time: 469 real time: 468 gc time: 265<br>
powerset<br>
> (go)<br>
cpu time: 469 real time: 469 gc time: 266<br>
powerset<br>
-----------------------------------------------------------------------------------<br>
C:\Documents and Settings\kyle\My Documents\Scheme\math>mzscheme -q
--require powerset.scm<br>
Welcome to MzScheme v369.8 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.<br>
> (go)<br>
cpu time: 563 real time: 563 gc time: 405<br>
powerset<br>
> (go)<br>
cpu time: 563 real time: 563 gc time: 376<br>
powerset<br>
> (exit)<br>
-----------------------------------------------------------------------------------<br>
I was really surprised that DrScheme beat out MzScheme. Do I have
something setup wrong on the command line of MzScheme, as I don't often
use the stand-alone interpreter, so I could be missing something?</font>
<pre class="moz-signature" cols="72"><font color="#000066">--kyle
Kyle Smith
airfoil at bellsouth dot net
schemekeys.blogspot.com</font>
</pre>
</body>
</html>