Overview

Though JSON is a ubiquitous data format, it is not a very compact format suitable for data exchange, for instance over a network. Hence, the library supports

to efficiently encode JSON values to byte vectors and to decode such vectors.

Comparison

Completeness

FormatSerializationDeserialization
BSONincomplete: top-level value must be an objectincomplete, but all JSON types are supported
CBORcompleteincomplete, but all JSON types are supported
MessagePackcompletecomplete
UBJSONcompletecomplete

Binary values

FormatBinary valuesBinary subtypes
BSONsupportedsupported
CBORsupportednot supported
MessagePacksupportedsupported
UBJSONnot supportednot supported

See binary values for more information.

Sizes

Formatcanada.jsontwitter.jsoncitm_catalog.jsonjeopardy.json
BSON85,8 %95,2 %95,8 %106,7 %
CBOR50,5 %86,3 %68,4 %88,0 %
MessagePack50,6 %86,0 %68,5 %87,9 %
UBJSON53,2 %91,3 %78,2 %96,6 %
UBJSON (size)58,6 %92,3 %86,8 %97,4 %
UBJSON (size+type)55,9 %92,3 %85,0 %95,0 %

Sizes compared to minified JSON value.