[Haskell-cafe] Need help - my haskell code is over 50 times slower than equivalent perl implementation

Darren Grant dedgrant at gmail.com
Tue Jun 24 16:46:06 UTC 2014


It's one of those quirks arising from historical decisions that makes
Haskell's non-strict idioms pathological where resources are limited. (A
very real and common case.) You need very strict, possibly explicit, file
handle management here.

Look to APIs that deal with this problem in a way that suits your situation
better: System.IO.Strict may be an option.

Cheers,
Darren
 On Jun 24, 2014 9:33 AM, "C K Kashyap" <ckkashyap at gmail.com> wrote:

> That is what is particularly frustrating...its a tiny program and somewhat
> trivial thing that I am trying to achieve.
>
> If I use mapM as suggested by others, I quickly run into -
>
> openFile: resource exhausted (Too many open files)
>
> Regards,
>
> Kashyap
>
> Regards,
> Kashyap
>
>
> On Tue, Jun 24, 2014 at 9:59 PM, Brandon Allbery <allbery.b at gmail.com>
> wrote:
>
>> On Tue, Jun 24, 2014 at 12:25 PM, C K Kashyap <ckkashyap at gmail.com>
>> wrote:
>>
>>> I used unsafeInterleaveIO after I ran into "too many open file handles"
>>> error.
>>
>>
>> That all by itself makes me think your problem is elsewhere and
>> unsafeInterleaveIO is just covering it up.
>>
>> --
>> brandon s allbery kf8nh                               sine nomine
>> associates
>> allbery.b at gmail.com
>> ballbery at sinenomine.net
>> unix, openafs, kerberos, infrastructure, xmonad
>> http://sinenomine.net
>>
>
>
> _______________________________________________
> 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/92cee07f/attachment.html>


More information about the Haskell-Cafe mailing list