ByteString I/O Performance

Seth Kurtzberg seth at cql.com
Sun Sep 2 23:55:34 EDT 2007



-----Original Message-----
From: libraries-bounces at haskell.org [mailto:libraries-bounces at haskell.org] On Behalf Of Bryan O'Sullivan
Sent: Sunday, September 02, 2007 11:23 PM
To: Peter Simons
Cc: libraries at haskell.org
Subject: Re: ByteString I/O Performance

Peter Simons wrote:

> One way to get malloc() out of the picture would be to provide a
> variant of hGet that takes an existing, pre-allocated buffer as an
> argument, so that the user can allocate a ByteString once and re-use
> it for every single hGet and hPut.

This is already quite easy to do.  See unsafeUseAsCStringLen in 
Data.ByteString.Base, and hGetBuf in System.IO.

Is it possible without resorting to an unsafeXXX function?

	<b
_______________________________________________
Libraries mailing list
Libraries at haskell.org
http://www.haskell.org/mailman/listinfo/libraries




More information about the Libraries mailing list