The ‘store’ package provides efficient binary serialization. There are a couple features that particularly distinguish it from most prior Haskell serialization libraries:
Its primary goal is speed. By default, direct machine representations are used for things like numeric values (
Word32, etc) and buffers (
Vector, etc). This means that much of serialization uses the equivalent of
Instead of implementing lazy serialization / deserialization involving multiple input / output buffers,
pokealways work with a single buffer. This buffer is allocated by asking the value for its size before encoding. This simplifies the encoding logic, and allows for highly optimized tight loops.
storecan optimize size computations by knowing when some types always use the same number of bytes. This allows us to compute the byte size of a
Vector Int32by just doing
length v * 4.
It also features:
Optimized serialization instances for many types from base, vector, bytestring, text, containers, time, template-haskell, and more.
TH and GHC Generics based generation of Store instances for datatypes
TH generation of testcases.
Store does not currently work at all on architectures which lack efficient
unaligned memory access (for example, older ARM processors). This is not a
fundamental limitation, but we do not currently require ARM or PowerPC support.
See #37 and
- Fixes a bug that could result in segfaults when reading corrupted data.
- Adds experimental
Data.Store.TypeHash. The new functionality is similar to TypeHash, but there are much fewer false positives of hashes changing.
- Now exports types related to generics
- Core functionality split into
Streaming support now prefixes each Message with a magic number, intended to detect mis-alignment of data frames. This is worth the overhead, because otherwise serialization errors could be more catastrophic - interpretting some bytes as a length tag and attempting to consume many bytes from the source.
weigh based allocations benchmark.
Streaming support now has checks for over/undershooting buffer
- First public release