Search code examples
haskelllazy-evaluationbytestring

Size of Chunk in Data.ByteString.Lazy


Module Data.ByteString.Lazy contain own implementation of ByteString type:

data ByteString = Empty | Chunk !S.ByteString ByteString

And there are following phrase about size of chunk:

The default chunk size is 64k, which should be good in most circumstances. For people with large L2 caches, you may want to increase this to fit your cache.

But nothing about how to do it. How can I increase default chunk size? Also, whether I will get an increase of performance, if chuck size will be significantly greater than those L2 cache?


Solution

  • It looks like you have to edit the source and install manually.

    Chunk sizes are set at the end of Data.ByteString.Lazy.Internal.