Home

Awesome

Benchmarks for Haskell serialization libraries.

For every library, we measure the serialization time, deserialization time and size of the encoded output for a set of test datasets.

Summary Results

The summary tables list, for every test, all libraries that are within 30% of the best result (with best library listed first).

Transfer Time

To merge all measures in a concrete use case, we estimate the total transfer time at different transmission speeds, that's to say the the time that it takes to serialize, move across a network (with no compression and no protocol overheads) and deserialize a given dataset.

Dataset\Measuretransfer [10 MBits]transfer [100 MBits]transfer [1000 MBits]
BinTree Directionflatflatflat,persist,store
BinTree Intflatflatflat,store,persist
Carsflatflatflat,store,persist
Irisflat,store,packman,persist,cereal,serialisestore,flat,persiststore,flat
[Direction]flatflat,persistflat,persist,store

When the network speed is low, transfer times are dominated by the size of the encoded dataset. At higher speeds, by the (de)serialisation times.

Tests are executed on an Intel Xeon W3520 @ 2.67GHz. On a slower machine, de(serialization) times would matter more, on a faster machine size would be more significant.

(De)serialization Times and Size

Dataset\Measuredeserializationserializationsize
BinTree Directionflat,persist,storepersist,storeflat
BinTree Intstore,persist,flat,cerealflat,persist,storeflat
Carspersist,flat,storestoreflat
Irisstore,persist,flatstorepackman,flat,cereal,persist,store,serialise
[Direction]flat,persist,cereal,storepersist,store,flatflat

Full Results

Full Results

Tested Libraries

Performance is not the only relevant property, depending on your needs you should also consider other features like laziness and compatibility.

PackageLazinessCompatibility
store-0.5.0.1StrictHaskell-Same-Architecture
packman-0.5.0LazyHaskell-Same-Architecture
cereal-0.5.7.0StrictHaskell
binary-0.8.5.1LazyHaskell
serialise-0.2.1.0LazyMulti-Language
flat-0.3.4StrictMulti-Language
persist-0.1StrictHaskell

Compatibility Levels (lowest to highest):

Test Data

TestDescription
BinTree DirectionBinary Tree of a simple enumeration data type
BinTree IntBinary Tree of Ints
[Direction]A List of a simple enumeration data type
CarsA dataset of Cars descriptions (mostly lists, enumerations and Ints)
IrisA dataset of Iris descriptions (mostly lists and floats)

Shout if you would like other tests to be added!

Running the Benchmarks

Run the benchmarks with:

stack bench :all

If you get this error:

...<stdout>: commitBuffer: invalid argument (invalid character)

Try:

export LC_ALL=C.UTF-8

The executable will write the report.md, report.html and report.json files containing the full test results and will print out the two summary results tables in markdown format.

Tests will be compiled with GHC 8.4.4.