[Haskell-cafe] Need help - my haskell code is over 50 times slower than equivalent perl implementation
Carter Schonwald
carter.schonwald at gmail.com
Tue Jun 24 16:19:08 UTC 2014
use mapM
you've got
mapMI :: (a -> IO b) -> [a] -> IO [b]
mapMI _ [] = return []
mapMI f (x:xs) = do y <- SIU.unsafeInterleaveIO (f x) ; ys <-
SIU.unsafeInterleaveIO (mapMI f xs) ; return (y:ys)
in your code, and thats going to make you sad
On Tue, Jun 24, 2014 at 12:08 PM, C K Kashyap <ckkashyap at gmail.com> wrote:
> Dear cafe,
>
> I have created a reproducible app here -
> https://github.com/ckkashyap/haskell-perf-repro
>
> Essentially I am trying to open a number of files and printing out their
> sized by reading them in and computing it's length.
>
> I have the equivalent perl program also there. I'd appreciate it very much
> if someone could take a look at my Haskell implementation and point out
> what I am doing wrong. Since it's over 50 times slower than the perl code,
> I assume I am doing something obviously incorrect.
>
> Regards,
> Kashyap
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140624/bbb485b5/attachment.html>
More information about the Haskell-Cafe
mailing list