Re: [Haskell-cafe] I killed performance of my code with Eval and Strategies

2012-11-17 Thread Janek S.
Just another definition of calculateSeq: calculateSeq = zipWith ($) (cycle [sin,cos]) . map sqrt This is just slightly slower than my implementation. I came up with a better implementation of parallel function: calculatePar2 :: [Double] - [Double] calculatePar2 xss = runEval $ concat

Re: [Haskell-cafe] I killed performance of my code with Eval and Strategies

2012-11-17 Thread Bertram Felgenhauer
Dear Janek, I am reading Simon Marlow's tutorial on parallelism and I have problems with correctly using Eval monad and Strategies. I *thought* I understand them but after writing some code it turns out that obviously I don't because parallelized code is about 20 times slower. Here's a short

Re: [Haskell-cafe] I killed performance of my code with Eval and Strategies

2012-11-16 Thread Dmitry Olshansky
Just another definition of calculateSeq: calculateSeq = zipWith ($) (cycle [sin,cos]) . map sqrt 2012/11/15 Janek S. fremenz...@poczta.onet.pl Do you really mean to calculate the 'sin . sqrt' of just the head of the list, or do you mean: calculateSeq = map (sin . sqrt) ? Argh.. of

Re: [Haskell-cafe] I killed performance of my code with Eval and Strategies

2012-11-15 Thread Janek S.
Do you really mean to calculate the 'sin . sqrt' of just the head of the list, or do you mean: calculateSeq = map (sin . sqrt)   ? Argh.. of course not! That's what you get when you code in the middle of a night. But in my code I will not be able to use map because elements will be processed

[Haskell-cafe] I killed performance of my code with Eval and Strategies

2012-11-14 Thread Janek S.
Dear Haskellers, I am reading Simon Marlow's tutorial on parallelism and I have problems with correctly using Eval monad and Strategies. I *thought* I understand them but after writing some code it turns out that obviously I don't because parallelized code is about 20 times slower. Here's a

Re: [Haskell-cafe] I killed performance of my code with Eval and Strategies

2012-11-14 Thread Bas van Dijk
On Nov 14, 2012 10:44 PM, Janek S. fremenz...@poczta.onet.pl wrote: calculateSeq :: [Double] - [Double] calculateSeq [] = [] calculateSeq (x:xs) = (sin . sqrt $ x) : xs Do you really mean to calculate the 'sin . sqrt' of just the head of the list, or do you mean: calculateSeq = map (sin .