On 2/27/13 2:17 AM, Vincent Hanquez wrote:
> Two major problems of lazy bytestrings is that:
>
> * 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').

If you're on a POSIX system, you can always make use of
unix-bytestring[1]. In particular, for lazy ByteStrings the function you
want is System.Posix.IO.ByteString.Lazy.fdWritev which performs a single
syscall to write all the chunks, and without manually concatenating them.

[1] http://hackage.haskell.org/package/unix-bytestring

-- 
Live well,
~wren


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to