Skip to content

Commit 44069ff

Browse files
committed
Update README.md
1 parent 767b1e3 commit 44069ff

1 file changed

Lines changed: 27 additions & 15 deletions

File tree

README.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,39 @@ Version 1.0
1515

1616
> BEVE is designed to be faster on modern hardware than CBOR, BSON, and MessagePack, but it is also more space efficient for typed arrays.
1717
18-
## Performance vs MessagePack
18+
## Performance
1919

20-
The following table lists the performance increase between BEVE with [Glaze](https://github.com/stephenberry/glaze) versus other libraries and their binary formats.
20+
BEVE with [Glaze](https://github.com/stephenberry/glaze) versus [JSON](https://www.json.org/), [MessagePack](https://github.com/msgpack/msgpack-c), and [CBOR](https://cbor.io/) (via [jsoncons](https://github.com/danielaparker/jsoncons)).
2121

22-
| Test | Libraries (vs [Glaze](https://github.com/stephenberry/glaze)) | Read (Times Faster) | Write (Times Faster) |
23-
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------- | -------------------- |
24-
| [Test Object](https://github.com/stephenberry/json_performance) | [msgpack-c](https://github.com/msgpack/msgpack-c) (c++) | 1.9X | 13X |
25-
| double array | [msgpack-c](https://github.com/msgpack/msgpack-c) (c++) | 14X | 50X |
26-
| float array | [msgpack-c](https://github.com/msgpack/msgpack-c) (c++) | 29X | 81X |
27-
| uint16_t array | [msgpack-c](https://github.com/msgpack/msgpack-c) (c++) | 73X | 167X |
22+
### Speedup vs BEVE (Baseline)
23+
24+
Higher means BEVE is faster by that factor. Format: Write/Read
25+
26+
| Test | JSON | MsgPack | CBOR |
27+
|------|------|---------|------|
28+
| Complex Nested Object | 2.3x/2.2x | 2.0x/9.8x | 7.6x/31.8x |
29+
| std::vector\<double\> (10K) | 151.0x/143.3x | 17.7x/38.3x | 126.4x/56.8x |
30+
| std::vector\<float\> (10K) | 234.8x/229.4x | 35.4x/73.9x | 130.1x/106.1x |
31+
| std::vector\<uint64_t\> (10K) | 45.2x/84.1x | 17.4x/36.6x | 126.9x/60.7x |
32+
| std::vector\<uint32_t\> (10K) | 55.7x/91.5x | 34.0x/72.5x | 127.7x/108.4x |
33+
| std::vector\<uint16_t\> (10K) | 93.4x/147.2x | 68.0x/181.2x | 126.1x/270.2x |
34+
35+
> CBOR benchmarks use [RFC 8746](https://datatracker.ietf.org/doc/rfc8746/) typed arrays via jsoncons `use_typed_arrays(true)`.
2836
2937
[Performance test code](https://github.com/stephenberry/binary_performance)
3038

31-
The table below shows binary message size versus BEVE. A positive value means the binary produced is larger than BEVE.
39+
### Message Sizes
40+
41+
| Test | JSON | BEVE | MessagePack | CBOR |
42+
|------|------|------|-------------|------|
43+
| Complex Nested Object | 616 B | 564 B | 545 B | 545 B |
44+
| std::vector\<double\> (10K) | 219.02 KB | 78.13 KB | 87.89 KB | 78.13 KB |
45+
| std::vector\<float\> (10K) | 124.11 KB | 39.07 KB | 48.83 KB | 39.07 KB |
46+
| std::vector\<uint64_t\> (10K) | 199.23 KB | 78.13 KB | 87.89 KB | 78.13 KB |
47+
| std::vector\<uint32_t\> (10K) | 104.97 KB | 39.07 KB | 48.83 KB | 39.07 KB |
48+
| std::vector\<uint16_t\> (10K) | 56.96 KB | 19.53 KB | 29.26 KB | 19.54 KB |
3249

33-
| Test | Libraries (vs [Glaze](https://github.com/stephenberry/glaze)) | Message Size |
34-
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------ |
35-
| [Test Object](https://github.com/stephenberry/json_performance) | [msgpack-c](https://github.com/msgpack/msgpack-c) (c++) | -3.4% |
36-
| double array | [msgpack-c](https://github.com/msgpack/msgpack-c) (c++) | +12% |
37-
| float array | [msgpack-c](https://github.com/msgpack/msgpack-c) (c++) | +25% |
38-
| uint16_t array | [msgpack-c](https://github.com/msgpack/msgpack-c) (c++) | +50% |
50+
BEVE and CBOR (with RFC 8746 typed arrays) store contiguous arrays as raw memory blocks, achieving the same message sizes. However, BEVE with Glaze is optimized to use direct `memcpy` operations, resulting in significantly higher throughput. MessagePack encodes each element individually with type tags, resulting in larger messages and slower performance for numeric arrays.
3951

4052
## Why Tagged Messages?
4153

0 commit comments

Comments
 (0)