Hello Claus,

Sunday, March 11, 2007, 10:03:59 PM, you wrote:

> both the array and strict list versions avoid some intermediate structures; 
> for the
> arbitrarily invented, relatively small inputs i've tried, strict lists are 
> the clear winner,
> thanks to lower memory traffic, but i'd like some feedback from the experts:

> -are there any obvious inefficiencies in the array code?

obviously, arrays version should create no temporary cells. the
problems was mainly due to 2 factors:

1) readArray m (i,j)
2) 'op' in 'l' which was passed as real closure and was not inlined
due to weakness of ghc optimizer

also, we should help strictness analyzer by marking all the variables
used in tight loops as strict. after that is done, we got 1000 times
less temporary data allocated and 5x faster execution. now it's a bit
faster than strict lists

-- 
Best regards,
 Bulat                            mailto:[EMAIL PROTECTED]

Attachment: CG.hs
Description: Binary data

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to