Popularity
7.4
Declining
Activity
0.0
Declining
21
4
5

Monthly Downloads: 130
Programming language: Haskell
License: LicenseRef-PublicDomain
Tags: Data     Fast    
Latest version: v0.1.1.0

fast-builder alternatives and similar packages

Based on the "fast" category.
Alternatively, view fast-builder alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of fast-builder or a related project?

Add another 'fast' Package

README

fast-builder

This is an efficient implementation of ByteString builder. It should be usable as a drop-in replacement for the Builder provided by the bytestring package.

This package only supports GHC 7.10 and later, because it heavily relies on the new oneShot primitive.

Implementation

The biggest efficiency gain comes from avoiding the continuation passing style. This means the builder can use the Haskell execution stack rather than a chain of heap-allocated closures when traversing a tree-shaped data structure.

When generating a strict ByteString, the builder simply accumulates bytes in an exponentially growing buffer. When generating a lazy ByteString that doesn't fit in one chunk, a new thread is forked and the builder runs there. This allows the builder to use the new thread's stack, independently from the consumer of the ByteString. All this happens transparently to the user.