Re: [Haskell-cafe] Shootout favoring imperative code

This uses getLine instead of getContents and is 3.8 times slower.
{-# OPTIONS -fglasgow-exts -O2 #-}
--
-- The Computer Language Shootout
-- http://shootout.alioth.debian.org/
--
-- compile with : ghc -O2 -o SumF SumF.hs
-- To get better performance set default heap size to 10MB
-- i.e. invoke as : ./SumF +RTS -H10M
On 1/5/06, Chris Kuklewicz
wrote: I did manage to tweak SumFile to use unboxed Int# and go 10% faster.
Interestingly, it's actually faster to do it this way than to call the C functions fgets and atoi...
However, I'm not sure it's "legal" since it's not using built-in line-based IO functions (which the spec states, for no apparent reason other than to favor languages whose IO convenience functions are low-level :-))
/S
-- Sebastian Sylvan +46(0)736-818655 UIN: 44640862
participants (1)
-
Chris Kuklewicz