1
0
mirror of https://github.com/nlohmann/json.git synced 2026-07-30 23:53:02 +04:00

Merge branch 'develop' of https://github.com/nlohmann/json into bon8

 Conflicts:
	doc/mkdocs/docs/api/basic_json/index.md
	doc/mkdocs/docs/features/binary_formats/bson.md
	doc/mkdocs/docs/features/binary_formats/index.md
	doc/mkdocs/mkdocs.yml
	include/nlohmann/json.hpp
	single_include/nlohmann/json.hpp
This commit is contained in:
Niels Lohmann
2021-12-31 14:53:13 +01:00
427 changed files with 6293 additions and 13280 deletions
@@ -1,4 +1,4 @@
# Overview
# Binary Formats
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
@@ -15,7 +15,7 @@ to efficiently encode JSON values to byte vectors and to decode such vectors.
### Completeness
| Format | Serialization | Deserialization |
| ----------- |---------------------------------------------- | -------------------------------------------- |
|-------------|-----------------------------------------------|----------------------------------------------|
| BSON | incomplete: top-level value must be an object | incomplete, but all JSON types are supported |
| CBOR | complete | incomplete, but all JSON types are supported |
| MessagePack | complete | complete |
@@ -25,7 +25,7 @@ to efficiently encode JSON values to byte vectors and to decode such vectors.
### Binary values
| Format | Binary values | Binary subtypes |
| ----------- | ------------- | --------------- |
|-------------|---------------|-----------------|
| BSON | supported | supported |
| CBOR | supported | supported |
| MessagePack | supported | supported |
@@ -37,7 +37,7 @@ See [binary values](../binary_values.md) for more information.
### Sizes
| Format | [canada.json](https://github.com/nlohmann/json_test_data/blob/master/nativejson-benchmark/canada.json) | [twitter.json](https://github.com/nlohmann/json_test_data/blob/master/nativejson-benchmark/twitter.json) | [citm_catalog.json](https://github.com/nlohmann/json_test_data/blob/master/nativejson-benchmark/citm_catalog.json) | [jeopardy.json](https://github.com/nlohmann/json_test_data/blob/master/jeopardy/jeopardy.json) | [sample.json](https://github.com/nlohmann/json_test_data/blob/master/json_testsuite/sample.json) |
| ------------------ | ----------- | ------------ | ----------------- | ------------- | ------------- |
|--------------------|-------------|--------------|-------------------|---------------| ------------- |
| BSON | 85,8 % | 95,2 % | 95,8 % | 106,7 % (1) | N/A (2) |
| CBOR | 50,5 % | 86,3 % | 68,4 % | 88,0 % | 87,2 % |
| MessagePack | 50,6 % | 86,0 % | 68,5 % | 87,9 % | 87,2 % |