[Haskell-cafe] Need help - my haskell code is over 50 times slower than equivalent perl implementation
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.
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)
> On Tue, Jun 24, 2014 at 9:59 PM, Brandon Allbery <allbery.b at gmail.com>
>> On Tue, Jun 24, 2014 at 12:25 PM, C K Kashyap <ckkashyap at gmail.com>
>>> I used unsafeInterleaveIO after I ran into "too many open file handles"
>> That all by itself makes me think your problem is elsewhere and
>> unsafeInterleaveIO is just covering it up.
>> brandon s allbery kf8nh sine nomine
>> allbery.b at gmail.com
>> ballbery at sinenomine.net
>> unix, openafs, kerberos, infrastructure, xmonad
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe