streamly icon indicating copy to clipboard operation
streamly copied to clipboard

Use CompactList for buffered data

Open harendra-kumar opened this issue 7 years ago • 0 comments

The compact-list package https://hackage.haskell.org/package/compact-list implements an append only list in a compact region. This list can be used for buffering the data generated by concurrent threads before the consumer consumes it. It can be specially helpful if the size of the data buffered is large. If the GC needs to go through the buffered structure, it may add significant overhead depending on the size of the data and how long it remains buffered.

The compact-list package itself needs to be improved, it currently uses an MVar for synchronization. For better performance we need to use CAS as we are using for synching the streamly buffers. It is possible that we may have to use a custom implementation of compact-list inside streamly package itself for perf reasons.

harendra-kumar avatar Sep 07 '18 02:09 harendra-kumar