All Projects → mgsloan → Store

mgsloan / Store

Licence: mit
Fast binary serialization in Haskell

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Store

Msgpack11
A tiny MessagePack library for C++11 (msgpack.org[C++11])
Stars: ✭ 78 (-22%)
Mutual labels:  serialization
Coq Serapi
Coq Protocol Playground with Se(xp)rialization of Internal Structures.
Stars: ✭ 87 (-13%)
Mutual labels:  serialization
Edn format
EDN reader and writer implementation in Python, using PLY (lex, yacc)
Stars: ✭ 92 (-8%)
Mutual labels:  serialization
Jsonifier
Fast and simple JSON encoding toolkit
Stars: ✭ 79 (-21%)
Mutual labels:  serialization
Avro4k
Avro support for kotlinx.serialization
Stars: ✭ 82 (-18%)
Mutual labels:  serialization
Msgpack Scala
MessagePack serializer implementation for Scala / msgpack.org[Scala]
Stars: ✭ 87 (-13%)
Mutual labels:  serialization
Thriftpy
Thriftpy has been deprecated, please migrate to https://github.com/Thriftpy/thriftpy2
Stars: ✭ 1,156 (+1056%)
Mutual labels:  serialization
Msgpack
msgpack.org[Go] MessagePack encoding for Golang
Stars: ✭ 1,353 (+1253%)
Mutual labels:  serialization
Binary
Generic and fast binary serializer for Go
Stars: ✭ 86 (-14%)
Mutual labels:  serialization
Java
jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go
Stars: ✭ 1,308 (+1208%)
Mutual labels:  serialization
Quickle
A quicker pickle 🥒
Stars: ✭ 80 (-20%)
Mutual labels:  serialization
Dahomey.json
The main purpose of this library is to bring missing features to the official .Net namespace System.Text.Json
Stars: ✭ 84 (-16%)
Mutual labels:  serialization
Protobuf Nim
Protobuf implementation in pure Nim that leverages the power of the macro system to not depend on any external tools
Stars: ✭ 90 (-10%)
Mutual labels:  serialization
Dartson
Dartson is a Dart library that can be used to convert Dart objects into a JSON string.
Stars: ✭ 78 (-22%)
Mutual labels:  serialization
Nestedtypes
BackboneJS compatibility layer for Type-R data framework.
Stars: ✭ 94 (-6%)
Mutual labels:  serialization
Json Mobx
Simple undo/redo and persistence for MobX
Stars: ✭ 78 (-22%)
Mutual labels:  serialization
Datakernel
Alternative Java platform, built from the ground up - with its own async I/O core and DI. Ultra high-performance, simple and minimalistic - redefines server-side programming, web-development and highload!
Stars: ✭ 87 (-13%)
Mutual labels:  serialization
Succ
Sexy and Utilitarian Code Configuration
Stars: ✭ 100 (+0%)
Mutual labels:  serialization
Fast Serialization
FST: fast java serialization drop in-replacement
Stars: ✭ 1,348 (+1248%)
Mutual labels:  serialization
Go
A high-performance 100% compatible drop-in replacement of "encoding/json"
Stars: ✭ 10,248 (+10148%)
Mutual labels:  serialization

store

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 (Int, Double, Word32, etc) and buffers (Text, ByteString, Vector, etc). This means that much of serialization uses the equivalent of memcpy.

    We have plans for supporting architecture independent serialization - see #36 and #31. This plan makes little endian the default, so that the most common endianness has no overhead.

    • Another way that the serialization behavior can vary is if integer-simple is used instead of GHC's default of using GMP. Integer serialized with the integer-simple flag enabled are not compatible with those serialized without the flag enabled.
  • Instead of implementing lazy serialization / deserialization involving multiple input / output buffers, peek and poke always 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.

  • store can 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 Int32 by 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.

  • Utilities for streaming encoding / decoding of Store encoded messages, via the store-streaming package.

Gotchas

Store is best used for communication between trusted processes and local caches. It can certainly be used for other purposes, but the builtin set of instances have some gotchas to be aware of:

  • Store's builtin instances serialize in a format which depends on machine endianness.

  • Store's builtin instances trust the data when deserializing. For example, the deserialization of Vector will read the vector's length from the first 8 bytes. It will then allocate enough memory to store all the elements. Malicious or malformed input could cause allocation of large amounts of memory. See issue #122.

Blog posts

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].