[Haskell-cafe] Re: OCaml list sees abysmal Language Shootoutresults

Robert robdockins at fastmail.fm
Thu Oct 7 09:04:17 EDT 2004


Here is a quick fix for the Random Numbers category.  Looks like a
classic space-leak, again on the arithmetic operations.  Speeds up
results for me about 6X and brings memory usage down out of the
stratosphere.

w/o strictness:

~/shootout$ time random 900000 +RTS -K32000000
75.544410151

real    0m0.756s
user    0m0.670s
sys     0m0.050s



w/ strictness:

~/shootout$ time random 900000 # <-- don't need massive heap
75.544410151

real    0m0.139s
user    0m0.100s
sys     0m0.010s

-- 
  Robert
  robdockins at fastmail.fm

-------------- next part --------------
A non-text attachment was scrubbed...
Name: random.patch
Type: text/x-diff
Size: 552 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/haskell-cafe/attachments/20041007/29fe8dad/random.bin


More information about the Haskell-Cafe mailing list