
Hello Simon,
On Wed, Apr 25, 2012 at 9:57 AM, Simon Marlow
Is this a good idea? How hard it would be to implement this optimisation?
[...] Personally I think it's at best very ambitious, and at worst not at all practical.
Thanks. I'll look into how to optimise .hi loading by more traditional means, then. I briefly looked at how marshalling is implemented in Ocaml (byterun/intern.c), and it looks like even though the Marshal module is unsafe and saves the data in an opaque format, the deserialisation algorithm is less radical than what I proposed. They go through the input buffer looking at the tag and size of the each object, and copy them to the heap buffer one-by-one. One interesting detail is that the heap buffer is allocated only once, because its size is known in advance. -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments