On Tue, Feb 26, 2013 at 11:17 PM, Vincent Hanquez <tab@snarc.org> wrote:
On Mon, Feb 25, 2013 at 11:59:42AM -0800, Johan Tibell wrote:Two major problems of lazy bytestrings is that:
> > - cereal can output a strict bytestring (runPut) or a lazy one
> > (runPutLazy), whilst binary only outputs lazy ones (runPut)
> >
>
> The lazy one is more general and you can use toStrict (from bytestring) to
> get a strict ByteString from a lazy one, without loss of performance.
* you can't pass it to a C bindings easily.
* doing IO with it without rewriting the chunks, can sometimes (depending
how the lazy bytestring has been produced) result in a serious degradation of
performance calling syscalls on arbitrary and small chunks (e.g. socket's 'send').
Personally, i also like the (obvious) stricter behavior of strict bytestring.