[Haskell-cafe] OCaml list sees abysmal Language Shootout results

Ketil Malde ketil+haskell at ii.uib.no
Wed Oct 6 04:26:51 EDT 2004


Ketil Malde <ketil+haskell at ii.uib.no> writes:

> To get memory consumption down, I tried a strict "update" function:

>    update k fm = let x = (get hash1 k + get fm k) 
>                  in x `seq` addToFM fm k x

> which slowed the program down(!), 

I wonder if this isn't due to never evaluating the values for
"foo_2" to "foo_9998" because of laziness?

> BTW, I looked at the shootout web pages, but I couldn't find the
> specification for any of the benchmarks.  What is and isn't allowed? 

For instance, changing the order of of the updates shaves another
10-20% off the time (because of cache-friendliness, I suppose):

  - let res = foldr update hash2 (concat $ replicate (read n) keys)
  + let res = foldr update hash2 (concat $ map (replicate (read n)) keys)

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Haskell-Cafe mailing list