Re: [nhc-users] fps and Foreign(Obj/Ptr)
Quoth Don Stewart <dons@galois.com>: [... re ByteString performance ] | I'd imagine there's others where space is a premium, where it would be | no contest to use a packed representation. Right, that was the initial attraction. I'm trying to put something together to exercise a little IMAP parser, and that means chunks of data that are potentially large enough that people worry about whether the size value could be larger than 32 bits. So it makes sense to use ByteStrings from the start - starting with socket input. At the other end, selected bits of data go to the C++ UI, and that's the other place where String isn't much use. That's where I was running out of foreign objects, and the larger foreign[] does help, thanks! Now I see I have a leak, though - the foreign objects are piling up where I was hoping they'd be gc'd, so I have more work to do. Maybe complicated by the fact that the Haskell producer and C++ consumer of these data are in separate threads, but I don't think that's my immediate problem. I bet if all Haskell objects were allocated in a fixed 1024 element list, people would notice space leaks much more quickly and reliably! Donn Cave, donn@avvanta.com
participants (1)
-
Donn Cave