📝 update table for binary formats

This commit is contained in:
Niels Lohmann
2021-09-11 15:40:47 +02:00
parent 7c55a91004
commit e9b1ab4e0a
2 changed files with 218 additions and 8 deletions

View File

@@ -36,13 +36,21 @@ See [binary values](../binary_values.md) for more information.
### Sizes
| Format | canada.json | twitter.json | citm_catalog.json | jeopardy.json |
| ------------------ | ----------- | ------------ | ----------------- | ------------- |
| BSON | 85,8 % | 95,2 % | 95,8 % | 106,7 % |
| CBOR | 50,5 % | 86,3 % | 68,4 % | 88,0 % |
| MessagePack | 50,6 % | 86,0 % | 68,5 % | 87,9 % |
| UBJSON | 53,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 % |
| 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 % |
| UBJSON | 53,2 % | 91,3 % | 78,2 % | 96,6 % | 88,2 % |
| UBJSON (size) | 58,6 % | 92,3 % | 86,8 % | 97,4 % | 89,3 % |
| UBJSON (size+type) | 55,9 % | 92,3 % | 85,0 % | 95,0 % | 89,5 % |
| BON8 | 50,5 % | 83,8 % | 63,5 % | 87,5 % | 85,6 % |
Sizes compared to minified JSON value.
Notes:
- (1) The JSON value is an array that needed to be wrapped in an object to be processed by BSON. We used an empty object key for minimal overhead.
- (2) The JSON value contained a string with code point `U+0000` which cannot be represented by BSON.
The JSON files are part of the [nlohmann/json_test_data](https://github.com/nlohmann/json_test_data) repository.