[Haskell-cafe] Haskell performance question
Thomas Schilling
nominolo at googlemail.com
Thu Nov 8 14:03:50 EST 2007
On Fri, 2007-11-09 at 00:51 +0600, Mikhail Gusarov wrote:
> "Dan Piponi" <dpiponi at gmail.com> writes:
>
> > Even though 'n' is 10 times bigger in the C program it runs much
> > faster than the Haskell program on my MacBook Pro with Haskell 6.6.1.
> > I've tried lots of different combinations of flags that I've found in
> > various postings to haskell-cafe but to no avail.
>
> import Data.List
>
> main = do
> print $ foldl' (+) 0 $ take 100000000 [1.0,1.0..]
>
> works 10 times faster than your C version. You just need to adapt to the
> radically different style of programming.
>
> Real Fortran programmer may write Fortran programs on any programming
> language :)
Good point, but this is not true for the OP. Take a look at Dan's blog.
It's linked on planet.haskell.org.
BTW. I prefer:
print 10000000.0
;)
More information about the Haskell-Cafe
mailing list