[Haskell-cafe] Need some advice around lazy IO
mukesh tiwari
mukeshtiwari.iiitm at gmail.com
Sat Mar 23 07:25:22 CET 2013
Hi Kashyap
I am not sure if this solution to your problem but try using Bytestring
rather than String in
parseXML' :: String -> XMLAST
parseXML' str =
f ast where
ast = parse (spaces >> xmlParser) "" str
f (Right x) = x
f (Left x) = CouldNotParse
Also see this post[1] My Space is Leaking..
Regards,
Mukesh Tiwari
[1] http://www.mega-nerd.com/erikd/Blog/
On Sat, Mar 23, 2013 at 11:11 AM, C K Kashyap <ckkashyap at gmail.com> wrote:
> Oops...I sent out the earlier message accidentally.
>
> I got some profiling done and got this pdf generated. I see unhealthy
> growths in my XML parser.
> https://github.com/ckkashyap/haskell-perf-repro/blob/master/RSXP.hs
> I must be not using parsec efficiently.
>
> Regards,
> Kashyap
>
>
>
>
> On Sat, Mar 23, 2013 at 11:07 AM, C K Kashyap <ckkashyap at gmail.com> wrote:
>
>> I got some profiling done and got this pdf generated. I see unhealthy
>> growths in my XML parser.
>>
>>
>>
>> On Fri, Mar 22, 2013 at 8:12 PM, C K Kashyap <ckkashyap at gmail.com> wrote:
>>
>>> Hi folks,
>>>
>>> I've run into more issues with my report generation tool .... I'd really
>>> appreciate some help.
>>>
>>> I've created a repro project on github to demonstrate the problem.
>>> git://github.com/ckkashyap/haskell-perf-repro.git
>>>
>>> There is a template xml file that needs to be replicated several times
>>> (3000 or so) under the data directory and then "driver" needs to be run.
>>> The memory used by driver keeps growing until it runs out of memory.
>>>
>>> Also, I'd appreciate some tips on how to go about debugging this
>>> situation. I am on the windows platform.
>>>
>>>
>>> Regards,
>>> Kashyap
>>>
>>>
>>> On Tue, Mar 19, 2013 at 1:11 PM, Kim-Ee Yeoh <ky3 at atamo.com> wrote:
>>>
>>>> On Tue, Mar 19, 2013 at 2:01 PM, Konstantin Litvinenko
>>>> <to.darkangel at gmail.com> wrote:
>>>> > Yes. You (and Dan) are totally right. 'Let' just bind expression, not
>>>> > evaluating it. Dan's evaluate trick force rnf to run before hClose.
>>>> As I
>>>> > said - it's tricky part especially for newbie like me :)
>>>>
>>>> To place this in perspective, one only needs to descend one or two
>>>> more layers before the semantics starts confusing even experts.
>>>>
>>>> Whereas the difference between seq and evaluate shouldn't be too hard
>>>> to grasp, that between evaluate and (return $!) is considerably more
>>>> subtle, as Edward Yang notified us 10 days ago. See the thread titled
>>>> To seq or not to seq.
>>>>
>>>> -- Kim-Ee
>>>>
>>>> _______________________________________________
>>>> Haskell-Cafe mailing list
>>>> Haskell-Cafe at haskell.org
>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>>
>>>
>>>
>>
>
> _______________________________________________
> 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/20130323/b28ae3f8/attachment.htm>
More information about the Haskell-Cafe
mailing list