[Haskell-cafe] Haskell performance question

Bulat Ziganshin bulat.ziganshin at gmail.com
Thu Nov 8 16:25:45 EST 2007


Hello Xiao-Yong,

Thursday, November 8, 2007, 10:41:11 PM, you wrote:

>> forM_ [0..n-2] $ \i -> do { return $! i;
>>                             x <- readArray a i; return $! x;
>>                             y <- readArray a (i+1); return $! y;
>>                             writeArray a (i+1) (x+y) }
>>
>> such cycle should be approx. 3-10 times slower than C one

> I didn't know you can do that.  Anyway, I tried OP's C and
> Haskell versions and the one with your strictness
> annotations.  It seems that the `$!' thing doesn't do much,
> or it's not doing anything.

i don't said that it will help, just that it may help. to know
exactly, one should either understand ghc strictness analyzer, or
check asm code

-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list