[Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

Claus Reinke claus.reinke at talk21.com
Tue Feb 27 18:38:15 EST 2007

> It'd be interesting to get the real code for this. Partly to just try
> optimising it but more so as a real test case for list/array fusion.
> As far as I see, there's no reason that consuming an assoc list of a
> bool vector with a foldl' (the ' is probably essential) should be slow.
> If it's fused properly no list cells should ever be allocated, we should
> get the loop over the vector.

fooling around with a dummy framework (loop over evaluate population*generations
times) suggests that it is far easier to get order-of-magnitude slow-downs and space
leaks by not evaluating the fitness results to the end than it is by not evaluating a short
inner loop (provided that its result is forced at each outer iteration, ie making sure that
the next generation is computed from the fitness *before* the next iteration starts). 

that's why i mentioned that this might not have been the source of their trouble. but 
as they did have resource trouble, it worries me that they present this kind of code 
without even discussing possible implications, strictness or optimisations. 

yes, it would be interesting to see if the rest of the code follows the same pattern 
(in which case i wouldn't be surprised about resource issues), or whether there is 
anything more interesting going on. as it stands, guessing what the authors might
have wanted to say in this paper isn't helping anyone. 


More information about the Haskell-Cafe mailing list