Minimal binary serialization library with focus on performance
HaskellNOASSERTION
Minimal binary serialization library with focus on performance
persist is a reasonably fast binary serialization library operating on strict ByteStrings with small dependency footprint.
The binary format uses the little endian representation on both big- and little endian machines.
The API design is mostly compatible with the cereal library. However the binary format
is not compatible with binary and cereal. Its internal machinery for deserialization is based on the store library.
Serialization generates ByteStrings directly instead of relying on the ByteString Builder.
Comparison with other libraries
flat - bit packing (!), fast, longer compile times
store - faster serialization, machine dependent, larger library, many dependencies
cereal - similar to persist, slower
binary - lazy and slower than persist
Benchmarks
Benchmarks are available at https://github.com/haskell-perf/serialization.
The following serialization and deserialization results were measured on GHC 8.6.2.
Results that are within 30% of the best result are displayed in bold.
deserialization (time)/BinTree Direction (best first)
package
performance
persist
1.0
store
1.1
flat
1.2
cereal
4.3
serialise
6.1
binary
7.8
packman
13.5
deserialization (time)/BinTree Int (best first)
package
performance
store
1.0
persist
1.1
cereal
1.3
flat
1.3
serialise
4.1
binary
4.8
packman
15.0
deserialization (time)/Cars (best first)
package
performance
persist
1.0
store
1.1
flat
1.3
cereal
2.9
packman
3.7
serialise
4.8
binary
7.2
deserialization (time)/Iris (best first)
package
performance
store
1.0
persist
1.1
flat
1.2
serialise
2.4
cereal
3.6
packman
3.6
binary
8.5
deserialization (time)/[Direction] (best first)
package
performance
persist
1.0
flat
1.1
store
1.2
cereal
1.3
serialise
3.0
binary
3.1
packman
11.0
serialization (time)/BinTree Direction (best first)