[Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

Conrad Parker conrad at metadecks.org
Mon Jan 29 19:30:32 EST 2007


On 28/01/07, Donald Bruce Stewart <dons at cse.unsw.edu.au> wrote:
>
> I've added raw primitives for:
>
>     {put,get}Wordhost
>     {put,get}Word16host
>     {put,get}Word32host
>     {put,get}Word64host
>
> which do unaligned, host-sized, host-endian packing of data.
>
> Writing is some 15% faster for Words, a bit less for reading (which is a
> bit unoptimised at the moment), and a bit less for other types. Needless
> to say, data serialised this way is only portable to the same
> architecture.

If the data header stores the alignment/size/endianness, then there's
no reason for the data to be unportable. The normal get* instances
(not get*host) could suffice for reading.

Conrad.


More information about the Haskell-Cafe mailing list