sieve.mlton

Doug Bagley doug@bagley.org
Tue, 18 Sep 2001 12:14:36 -0500


Stephen Weeks wrote:

Hi Stephen,
I apologize again for misplacing your mail and the long delay in
response. 

> > Hi Doug. I see that sieve.mlton was recently changed (back) to use
> > Word8Array instead of bool array. I find that version to be less
> > idiomatic. Also, on my machine, with a slightly newer version of
> > MLton, the change slowed down the benchmark from what I sent you
> > on June 10 by a factor of 6. That's quite a lot. I would like to
> > request changing the benchmark back to the more idiomatic and 6x
> > faster (or whatever it is on your machine) version. Thanks.
> 
> Hello again. Henry figured out what was going on to cause the large
> discrepancy between the two versions of sieve. It had nothing to do
> with Word8Array vs bool array. It had everything to do with a bug in
> the original version of sieve.mlton that caused it to only initialize
> the array once, instead of once per loop.

Yes, that was how I remember it ... Dan Wang pointed out to me that
the array of flags needed to be initialized each time through the
loop, to be like the rest of the programs.  

As for notification of changes, I'll try to keep you informed. At some
point, I may try to set up automatic notifications one could subscribe
to, but I'm not sure where the shootout is headed at the moment.

> With the bug fixed, the performance of the Word8Array and bool array
> versions are nearly identical in MLton. I would like to request that
> sieve.mlton be changed to the following, which is essentially the
> same as what you have now, except that it uses bool array instead of
> Word8Array. Thanks again.

Thanks, your new version takes off about 0.55 CPU seconds for N=900 on
my machine.

Cheers,
Doug