[Haskell-cafe] Re: Over-allocation
Gracjan Polak
gracjanpolak at gmail.com
Wed Nov 21 11:43:52 EST 2007
Ketil Malde <ketil+haskell <at> ii.uib.no> writes:
>
> Then you get the memory behavior you ask for. Unevaluated strings are
> extremely expensive, something like 12 bytes per char on 32 bit, twice
> that on 64 bits, and then you need GC overhead, etc. ByteStrings are
> much better, but you then probably need to implement your own XML
> parsing.
>
My lazy chunks have type ByteString -> Object. Only internally they use
ByteString.unpack to get the list of Word8s to parse them.
My parser is totally my own so I can do anything I wish. Except it is hard for
me to image a parser working on something else than [Word8]. How do I do this?
So how do I get rid of those (:) and W8# that are allocated everywhere on my
heap?
Thanks for the suggestion for -hd, really useful option!
--
Gracjan
More information about the Haskell-Cafe
mailing list