ByteString I/O Performance

Tomasz Zielonka tomasz.zielonka at gmail.com
Mon Sep 3 01:49:01 EDT 2007


On Sun, Sep 02, 2007 at 10:16:59PM -0700, Stefan O'Rear wrote:
> On Mon, Sep 03, 2007 at 07:11:45AM +0200, Tomasz Zielonka wrote:
> > I just wrote this, before I read you proposition:
> > As safer alternative would be to keep a cache of pre-malloced buffers,
> > populated by the ByteString finalizer. But the bookkeeping cost could
> > outweight the benefit of avoiding malloc.
> 
> How are you getting these bytestrings?  Normal bytestring allocation
> doesn't use malloc and doesn't use finalizers; it calls the (deceptively
> named) mallocForeignPtrBytes function, which allocates a block of data
> in the pinned GHC heap, nearly like any other Haskell object.

IIUC, the discussion was about malloced ByteStrings...

Best regards
Tomek


More information about the Libraries mailing list