diff --git a/docs/mkdocs/docs/home/blog/how_3_13_0_got_faster.md b/docs/mkdocs/docs/home/blog/how_3_13_0_got_faster.md index caf11c801..4fccb968d 100644 --- a/docs/mkdocs/docs/home/blog/how_3_13_0_got_faster.md +++ b/docs/mkdocs/docs/home/blog/how_3_13_0_got_faster.md @@ -5,9 +5,10 @@ + develop b2674a4a2f with the open non-draft pull requests #5990, #5991, #5992, #5996, #5997, #5998, #5999 and + #6000 merged (local branch local/all-prs-1101 at 71d735b73f): suite, timeline endpoint, Appendix D and the scalar + runs 11-02. The comparison with other libraries is from 10-31 (develop 9c349b1d7c with the then open pull + requests); the changes since don't touch json_document parsing, validation or dump(). --> Since 2016, the [README](https://github.com/nlohmann/json#readme) of this library has said this about speed: @@ -61,7 +62,7 @@ The rows above are chosen to show the range. All 182 benchmarks of the suite: --8<-- "images/perf_blog_distribution.svg" -

How many of the suite's 182 benchmarks got how much faster. The one below 1× is copying `citm_catalog.json` without destroying the copy. Every row is in [Appendix B](#b-3120-against-3130).

+

How many of the suite's 182 benchmarks got how much faster. The two below 1× are copying `citm_catalog.json` and `twitter.json` without destroying the copy. Every row is in [Appendix B](#b-3120-against-3130).

The median benchmark got 2.9× as fast. Copying and comparing values gained the least, and the largest gains come from fixing algorithms rather than tuning them (theme 7). @@ -686,8 +687,8 @@ with GCC. The binary readers also stopped taking every element through their general dispatch. When an array opens, the CBOR and MessagePack readers read the numbers, booleans and nulls that follow in one loop, and the UBJSON and BJData readers do the same for arrays with a type marker. Reading an array of a million integers from CBOR or MessagePack -got 40 to 45 % faster, and `canada.json` 7 to 9 %. The loop is not free: an array of 100,000 arrays `[1,2]` reads 2 to -3 % slower than without it, just because the loop's code is there. We kept it. +got 43 to 45 % faster, and `canada.json` 10 to 12 %. The loop is not free: 1,000 arrays nested in each other read 6 to +8 % slower than without it, because each of them enters the loop only to find another array. We kept it. ### Smaller ones @@ -1053,7 +1054,7 @@ loop). The walk allocates nothing and calls nothing that can throw, which fixed destructor flattened children into a `std::vector`, which ignored the allocator type and could let `std::bad_alloc` escape from a `noexcept` destructor. A test checks with a counting allocator that destroying any value allocates nothing. Against 3.12.0, destroying a parsed document is -1.26 to 1.57 times as fast in our suite, and destroying an array of one million small objects 1.37 times. +1.24 to 1.55 times as fast in our suite, and destroying an array of one million small objects 1.37 times. ## 8 Build a different data structure { #theme-8 } @@ -1484,24 +1485,24 @@ The rows of the first chart: | workload | 3.12.0 | 3.13.0 | speedup | | --- | --: | --: | --: | -| `json::parse()` of `twitter.json` | 3.18 ms | 1.03 ms | 3.1× | -| `json::parse()` of `citm_catalog.json` | 7.26 ms | 1.73 ms | 4.2× | -| `json::parse()` of `canada.json` | 15.0 ms | 4.36 ms | 3.4× | -| `json::parse()` of `canada.json`, indented by 4 spaces | 33.1 ms | 5.04 ms | 6.6× | -| `ordered_json::parse()` of `citm_catalog.json` | 10.8 ms | 1.61 ms | 6.7× | -| `json::parse()` of `twitter.json` from an `std::ifstream` | 3.28 ms | 1.34 ms | 2.4× | -| `json::parse()` of `citm_catalog.json` from a `FILE*` | 34.3 ms | 7.26 ms | 4.7× | -| `json::accept()` of `citm_catalog.json` | 6.27 ms | 0.822 ms | 7.6× | -| `dump()` of `twitter.json` | 1.38 ms | 0.206 ms | 6.7× | -| `dump()` of `canada.json` | 6.59 ms | 2.26 ms | 2.9× | -| `dump(4)` of `citm_catalog.json` | 1.90 ms | 0.413 ms | 4.6× | -| `to_cbor()` of `twitter.json` | 0.632 ms | 0.141 ms | 4.5× | -| `from_cbor()` of `twitter.json` from memory | 3.03 ms | 0.938 ms | 3.2× | -| `from_cbor()` of `twitter.json` from a `FILE*` | 9.77 ms | 1.50 ms | 6.5× | -| `diff()` of `canada.json` with every eighth scalar changed | 37.9 ms | 3.64 ms | 10.4× | -| iterating over every value of `canada.json` | 0.863 ms | 0.320 ms | 2.7× | -| copying `citm_catalog.json` and destroying the copy | 1.61 ms | 1.44 ms | 1.11× | -| `==` of `citm_catalog.json` and a copy | 0.267 ms | 0.250 ms | 1.07× | +| `json::parse()` of `twitter.json` | 3.14 ms | 1.03 ms | 3.1× | +| `json::parse()` of `citm_catalog.json` | 7.16 ms | 1.76 ms | 4.1× | +| `json::parse()` of `canada.json` | 14.8 ms | 4.48 ms | 3.3× | +| `json::parse()` of `canada.json`, indented by 4 spaces | 33.1 ms | 5.22 ms | 6.3× | +| `ordered_json::parse()` of `citm_catalog.json` | 10.7 ms | 1.63 ms | 6.5× | +| `json::parse()` of `twitter.json` from an `std::ifstream` | 3.29 ms | 1.34 ms | 2.5× | +| `json::parse()` of `citm_catalog.json` from a `FILE*` | 34.0 ms | 7.25 ms | 4.7× | +| `json::accept()` of `citm_catalog.json` | 6.28 ms | 0.902 ms | 7.0× | +| `dump()` of `twitter.json` | 1.37 ms | 0.207 ms | 6.6× | +| `dump()` of `canada.json` | 6.63 ms | 2.25 ms | 2.9× | +| `dump(4)` of `citm_catalog.json` | 1.89 ms | 0.417 ms | 4.5× | +| `to_cbor()` of `twitter.json` | 0.625 ms | 0.145 ms | 4.3× | +| `from_cbor()` of `twitter.json` from memory | 3.00 ms | 0.942 ms | 3.2× | +| `from_cbor()` of `twitter.json` from a `FILE*` | 9.66 ms | 1.51 ms | 6.4× | +| `diff()` of `canada.json` with every eighth scalar changed | 37.5 ms | 3.67 ms | 10.2× | +| iterating over every value of `canada.json` | 0.859 ms | 0.308 ms | 2.8× | +| copying `citm_catalog.json` and destroying the copy | 1.60 ms | 1.44 ms | 1.11× | +| `==` of `citm_catalog.json` and a copy | 0.263 ms | 0.252 ms | 1.05× |

Time per call with 3.12.0 and 3.13.0, Google Benchmark suite on an Apple M1 Max, median of 8 runs; the speedup is the old time divided by the new one. The parse rows do not include destroying the result (the suite pauses the timer for that).

@@ -1509,188 +1510,188 @@ The rows of the first chart: | benchmark | 3.12.0 | 3.13.0 | speedup | | --- | --: | --: | --: | - | `Accept/canada` | 12.7 ms | 2.26 ms | 5.61× | - | `Accept/citm_catalog` | 6.27 ms | 822 µs | 7.63× | - | `Accept/floats` | 113 ms | 24 ms | 4.70× | - | `Accept/jeopardy` | 218 ms | 55.8 ms | 3.90× | - | `Accept/signed_ints` | 113 ms | 28.6 ms | 3.95× | - | `Accept/small_signed_ints` | 55.5 ms | 18.8 ms | 2.95× | - | `Accept/twitter` | 2.44 ms | 474 µs | 5.15× | - | `Accept/unsigned_ints` | 113 ms | 27.5 ms | 4.13× | - | `BinaryToCbor/1024` | 297 ns | 99.6 ns | 2.99× | - | `BinaryToCbor/128` | 248 ns | 112 ns | 2.23× | - | `BinaryToCbor/16384` | 973 ns | 399 ns | 2.44× | - | `BinaryToCbor/16` | 243 ns | 47.8 ns | 5.08× | - | `BinaryToCbor/2048` | 320 ns | 118 ns | 2.70× | - | `BinaryToCbor/256` | 266 ns | 87.3 ns | 3.05× | - | `BinaryToCbor/32768` | 1.56 µs | 801 ns | 1.94× | - | `BinaryToCbor/32` | 248 ns | 48.5 ns | 5.12× | - | `BinaryToCbor/4096` | 396 ns | 163 ns | 2.44× | - | `BinaryToCbor/512` | 286 ns | 96.1 ns | 2.97× | - | `BinaryToCbor/64` | 250 ns | 81.9 ns | 3.06× | - | `BinaryToCbor/8192` | 504 ns | 244 ns | 2.07× | - | `BinaryToCbor/8` | 244 ns | 47.3 ns | 5.16× | - | `Copy/canada` | 3.63 ms | 2.82 ms | 1.29× | - | `Copy/citm_catalog` | 1.61 ms | 1.44 ms | 1.11× | - | `Copy/twitter` | 795 µs | 713 µs | 1.12× | - | `CopyAssign/canada` | 3.67 ms | 2.84 ms | 1.29× | - | `CopyAssign/citm_catalog` | 1.62 ms | 1.47 ms | 1.11× | - | `CopyAssign/twitter` | 797 µs | 724 µs | 1.10× | - | `CopyOnly/canada` | 1.51 ms | 1.48 ms | 1.02× | - | `CopyOnly/citm_catalog` | 736 µs | 779 µs | 0.94× | - | `CopyOnly/twitter` | 396 µs | 394 µs | 1.00× | - | `CopyRing/canada` | 3.66 ms | 2.88 ms | 1.27× | - | `CopyRing/citm_catalog` | 1.67 ms | 1.49 ms | 1.12× | - | `CopyRing/twitter` | 852 µs | 758 µs | 1.12× | - | `DestroyOnly/canada` | 2.11 ms | 1.35 ms | 1.57× | - | `DestroyOnly/citm_catalog` | 878 µs | 665 µs | 1.32× | - | `DestroyOnly/twitter` | 401 µs | 318 µs | 1.26× | - | `Diff/canada` | 37.9 ms | 3.64 ms | 10.4× | - | `Diff/citm_catalog` | 6.67 ms | 1.06 ms | 6.27× | - | `Diff/twitter` | 4.78 ms | 626 µs | 7.64× | - | `Dump/canada / -` | 6.59 ms | 2.26 ms | 2.92× | - | `Dump/canada / 4` | 8.74 ms | 2.98 ms | 2.94× | - | `Dump/citm_catalog / -` | 1.36 ms | 289 µs | 4.73× | - | `Dump/citm_catalog / 4` | 1.9 ms | 413 µs | 4.59× | - | `Dump/floats / -` | 62 ms | 23.3 ms | 2.66× | - | `Dump/floats / 4` | 70 ms | 24.3 ms | 2.88× | - | `Dump/jeopardy / -` | 199 ms | 30 ms | 6.62× | - | `Dump/jeopardy / 4` | 218 ms | 34.2 ms | 6.37× | - | `Dump/signed_ints / -` | 23.5 ms | 10.4 ms | 2.25× | - | `Dump/signed_ints / 4` | 31.5 ms | 11 ms | 2.85× | - | `Dump/small_signed_ints / -` | 17.5 ms | 7.78 ms | 2.25× | - | `Dump/small_signed_ints / 4` | 24.6 ms | 8.6 ms | 2.86× | - | `Dump/twitter / -` | 1.38 ms | 206 µs | 6.69× | - | `Dump/twitter / 4` | 1.55 ms | 245 µs | 6.32× | - | `Dump/unsigned_ints / -` | 23.2 ms | 7.89 ms | 2.94× | - | `Dump/unsigned_ints / 4` | 31.3 ms | 8.37 ms | 3.75× | - | `Equal/canada` | 453 µs | 327 µs | 1.39× | - | `Equal/citm_catalog` | 267 µs | 250 µs | 1.07× | - | `Equal/twitter` | 140 µs | 126 µs | 1.11× | - | `Flatten/canada` | 28.2 ms | 10.9 ms | 2.59× | - | `Flatten/citm_catalog` | 6.31 ms | 3.01 ms | 2.10× | - | `Flatten/twitter` | 3.47 ms | 2.01 ms | 1.73× | - | `FlattenOrdered/citm_catalog` | 251 ms | 1.37 ms | 183× | - | `FlattenOrdered/twitter` | 48 ms | 846 µs | 56.8× | - | `FromBinaryBuffer/bjdata / canada` | 8.07 ms | 4.09 ms | 1.97× | - | `FromBinaryBuffer/bjdata / twitter` | 3.1 ms | 945 µs | 3.28× | - | `FromBinaryBuffer/bjdata_optimized / canada` | 8.56 ms | 2.4 ms | 3.56× | - | `FromBinaryBuffer/bjdata_optimized / twitter` | 3.08 ms | 942 µs | 3.27× | - | `FromBinaryBuffer/bson / canada` | 9.21 ms | 4.26 ms | 2.16× | - | `FromBinaryBuffer/bson / citm_catalog` | 3.84 ms | 1.59 ms | 2.41× | - | `FromBinaryBuffer/bson / twitter` | 3.05 ms | 914 µs | 3.34× | - | `FromBinaryBuffer/cbor / canada` | 8.25 ms | 2.1 ms | 3.93× | - | `FromBinaryBuffer/cbor / citm_catalog` | 3.67 ms | 1.41 ms | 2.61× | - | `FromBinaryBuffer/cbor / floats` | 28.8 ms | 5.54 ms | 5.20× | - | `FromBinaryBuffer/cbor / jeopardy` | 355 ms | 112 ms | 3.16× | - | `FromBinaryBuffer/cbor / signed_ints` | 35.1 ms | 10.6 ms | 3.30× | - | `FromBinaryBuffer/cbor / twitter` | 3.03 ms | 938 µs | 3.23× | - | `FromBinaryBuffer/msgpack / canada` | 8.19 ms | 2.11 ms | 3.89× | - | `FromBinaryBuffer/msgpack / citm_catalog` | 3.69 ms | 1.39 ms | 2.66× | - | `FromBinaryBuffer/msgpack / jeopardy` | 349 ms | 108 ms | 3.24× | - | `FromBinaryBuffer/msgpack / twitter` | 3 ms | 919 µs | 3.27× | - | `FromBinaryBuffer/ubjson / canada` | 8.08 ms | 4.1 ms | 1.97× | - | `FromBinaryBuffer/ubjson / citm_catalog` | 3.81 ms | 1.74 ms | 2.20× | - | `FromBinaryBuffer/ubjson / jeopardy` | 368 ms | 113 ms | 3.25× | - | `FromBinaryBuffer/ubjson / twitter` | 3.11 ms | 949 µs | 3.28× | - | `FromBinaryBuffer/ubjson_optimized / canada` | 8.35 ms | 2.37 ms | 3.53× | - | `FromBinaryBuffer/ubjson_optimized / twitter` | 3.06 ms | 939 µs | 3.26× | - | `FromBinaryFile/bjdata / twitter` | 10.2 ms | 1.88 ms | 5.40× | - | `FromBinaryFile/bson / twitter` | 10 ms | 1.75 ms | 5.73× | - | `FromBinaryFile/cbor / canada` | 14.1 ms | 4.34 ms | 3.24× | - | `FromBinaryFile/cbor / twitter` | 9.77 ms | 1.5 ms | 6.50× | - | `FromBinaryFile/ubjson / canada` | 13.4 ms | 6.25 ms | 2.14× | - | `FromBinaryFile/ubjson / twitter` | 10.3 ms | 1.89 ms | 5.45× | - | `FromBinaryShape/containers / bjdata` | 14 ms | 6.98 ms | 2.00× | - | `FromBinaryShape/containers / bson` | 16.7 ms | 7.58 ms | 2.20× | - | `FromBinaryShape/containers / cbor` | 13.8 ms | 3.93 ms | 3.51× | - | `FromBinaryShape/containers / msgpack` | 13.7 ms | 3.87 ms | 3.53× | - | `FromBinaryShape/containers / ubjson_optimized` | 14.5 ms | 4.44 ms | 3.27× | - | `FromBinaryShape/containers / ubjson` | 13.9 ms | 6.95 ms | 2.00× | - | `FromBinaryShape/nested / bjdata` | 94.7 µs | 37.6 µs | 2.52× | - | `FromBinaryShape/nested / bson` | 101 µs | 41.8 µs | 2.41× | - | `FromBinaryShape/nested / cbor` | 92.5 µs | 35.3 µs | 2.62× | - | `FromBinaryShape/nested / msgpack` | 91.1 µs | 34.8 µs | 2.62× | - | `FromBinaryShape/nested / ubjson` | 93.7 µs | 37.6 µs | 2.50× | - | `FromBinaryShape/scalars / bjdata` | 24.2 ms | 11.2 ms | 2.16× | - | `FromBinaryShape/scalars / cbor` | 25.4 ms | 5.77 ms | 4.39× | - | `FromBinaryShape/scalars / msgpack` | 24.1 ms | 5.7 ms | 4.22× | - | `FromBinaryShape/scalars / ubjson` | 24.4 ms | 11.2 ms | 2.17× | - | `FromCborChunkedString/10000 chunks` | 89.8 µs | 81.1 µs | 1.11× | - | `FromMsgpack/canada` | 13.9 ms | 4.36 ms | 3.19× | - | `FromMsgpack/citm_catalog` | 8.78 ms | 2.19 ms | 4.01× | - | `FromMsgpack/floats` | 58.9 ms | 27.2 ms | 2.17× | - | `FromMsgpack/jeopardy` | 1,120 ms | 179 ms | 6.26× | - | `FromMsgpack/signed_ints` | 61.9 ms | 31.9 ms | 1.94× | - | `FromMsgpack/small_signed_ints` | 61.7 ms | 33.3 ms | 1.86× | - | `FromMsgpack/twitter` | 9.71 ms | 1.43 ms | 6.78× | - | `FromMsgpack/unsigned_ints` | 54.7 ms | 27.4 ms | 2.00× | - | `GetArray>` | 2.23 µs | 629 ns | 3.54× | - | `GetArray>` | 7.99 µs | 1.15 µs | 6.92× | - | `GetArray>` | 58.3 µs | 41 µs | 1.42× | - | `GetArray>` | 6.58 µs | 655 ns | 10.1× | - | `GetMap/citm_catalog` | 3.38 ms | 2.38 ms | 1.42× | - | `GetVectorDouble/floats` | 6.56 ms | 638 µs | 10.3× | - | `GetVectorInt/signed_ints` | 7.93 ms | 3.37 ms | 2.36× | - | `Iterate/canada` | 863 µs | 320 µs | 2.70× | - | `Iterate/citm_catalog` | 295 µs | 165 µs | 1.79× | - | `Iterate/twitter` | 86.2 µs | 62 µs | 1.39× | - | `JsonPointerAt/citm_catalog` | 1.8 ms | 1.11 ms | 1.62× | - | `JsonPointerAt/twitter` | 783 µs | 578 µs | 1.36× | - | `JsonPointerContains/citm_catalog` | 2.68 ms | 1.21 ms | 2.21× | - | `JsonPointerContains/twitter` | 1.28 ms | 601 µs | 2.12× | - | `JsonPointerParse/citm_catalog` | 5.63 ms | 2.15 ms | 2.62× | - | `JsonPointerParse/twitter` | 2.42 ms | 982 µs | 2.46× | - | `JsonPointerToString/citm_catalog` | 6.61 ms | 1.86 ms | 3.56× | - | `JsonPointerToString/twitter` | 2.17 ms | 790 µs | 2.74× | - | `ParseFILE/canada` | 52.1 ms | 13.9 ms | 3.76× | - | `ParseFILE/citm_catalog` | 34.3 ms | 7.26 ms | 4.72× | - | `ParseFILE/twitter` | 13.4 ms | 3.26 ms | 4.09× | - | `ParseFile/canada` | 17.2 ms | 6.08 ms | 2.84× | - | `ParseFile/citm_catalog` | 7.65 ms | 2.39 ms | 3.21× | - | `ParseFile/floats` | 127 ms | 47.1 ms | 2.70× | - | `ParseFile/jeopardy` | 325 ms | 158 ms | 2.05× | - | `ParseFile/signed_ints` | 124 ms | 45.8 ms | 2.71× | - | `ParseFile/small_signed_ints` | 62.9 ms | 31.6 ms | 1.99× | - | `ParseFile/twitter` | 3.28 ms | 1.34 ms | 2.44× | - | `ParseFile/unsigned_ints` | 120 ms | 44 ms | 2.73× | - | `ParseIndented/canada / 4` | 33.1 ms | 5.04 ms | 6.57× | - | `ParseIndented/citm_catalog / 4` | 7.12 ms | 1.74 ms | 4.09× | - | `ParseIndented/jeopardy / 4` | 333 ms | 129 ms | 2.58× | - | `ParseIndented/twitter / 4` | 3.57 ms | 1.09 ms | 3.27× | - | `ParseStreamValues/ndjson` | 6.97 ms | 3.71 ms | 1.88× | - | `ParseStreamValues/numbers` | 1.9 ms | 374 µs | 5.07× | - | `ParseString/canada` | 15 ms | 4.36 ms | 3.45× | - | `ParseString/citm_catalog` | 7.26 ms | 1.73 ms | 4.19× | - | `ParseString/floats` | 117 ms | 30.3 ms | 3.86× | - | `ParseString/jeopardy` | 305 ms | 128 ms | 2.38× | - | `ParseString/signed_ints` | 119 ms | 31.6 ms | 3.76× | - | `ParseString/small_signed_ints` | 59.7 ms | 22 ms | 2.71× | - | `ParseString/twitter` | 3.18 ms | 1.03 ms | 3.10× | - | `ParseString/unsigned_ints` | 118 ms | 30.4 ms | 3.89× | - | `ParseStringOrdered/canada` | 15.2 ms | 4.31 ms | 3.53× | - | `ParseStringOrdered/citm_catalog` | 10.8 ms | 1.61 ms | 6.67× | - | `ParseStringOrdered/jeopardy` | 358 ms | 110 ms | 3.26× | - | `ParseStringOrdered/twitter` | 4.34 ms | 898 µs | 4.83× | - | `Patch/canada` | 9.89 ms | 3.31 ms | 2.99× | - | `Patch/citm_catalog` | 2.5 ms | 1.59 ms | 1.57× | - | `Patch/twitter` | 1.45 ms | 841 µs | 1.72× | - | `SaxParse/canada` | 12.8 ms | 3.21 ms | 3.99× | - | `SaxParse/citm_catalog` | 6.33 ms | 948 µs | 6.68× | - | `SaxParse/twitter` | 2.47 ms | 467 µs | 5.29× | - | `ToCbor/canada` | 1.36 ms | 547 µs | 2.49× | - | `ToCbor/citm_catalog` | 1.02 ms | 255 µs | 3.99× | - | `ToCbor/floats` | 8.88 ms | 1.88 ms | 4.71× | - | `ToCbor/jeopardy` | 71 ms | 21 ms | 3.37× | - | `ToCbor/signed_ints` | 11.2 ms | 2.75 ms | 4.06× | - | `ToCbor/small_signed_ints` | 10.1 ms | 2.36 ms | 4.28× | - | `ToCbor/twitter` | 632 µs | 141 µs | 4.48× | - | `ToCbor/unsigned_ints` | 8 ms | 2.75 ms | 2.91× | - | `ToJsonStrings/copy` | 5.82 ms | 5.48 ms | 1.06× | - | `ToJsonStrings/move` | 5.8 ms | 3 ms | 1.93× | - | `Unflatten/canada` | 41 ms | 10.7 ms | 3.84× | - | `Unflatten/citm_catalog` | 9.67 ms | 3.45 ms | 2.81× | - | `Unflatten/twitter` | 4.57 ms | 2.09 ms | 2.19× | + | `Accept/canada` | 12.5 ms | 2.29 ms | 5.48× | + | `Accept/citm_catalog` | 6.28 ms | 902 µs | 6.96× | + | `Accept/floats` | 112 ms | 22 ms | 5.10× | + | `Accept/jeopardy` | 213 ms | 57 ms | 3.74× | + | `Accept/signed_ints` | 113 ms | 27.4 ms | 4.15× | + | `Accept/small_signed_ints` | 55.2 ms | 17.5 ms | 3.16× | + | `Accept/twitter` | 2.44 ms | 469 µs | 5.19× | + | `Accept/unsigned_ints` | 112 ms | 28.7 ms | 3.90× | + | `BinaryToCbor/1024` | 291 ns | 104 ns | 2.78× | + | `BinaryToCbor/128` | 245 ns | 114 ns | 2.14× | + | `BinaryToCbor/16384` | 957 ns | 417 ns | 2.30× | + | `BinaryToCbor/16` | 242 ns | 48.6 ns | 4.98× | + | `BinaryToCbor/2048` | 315 ns | 124 ns | 2.54× | + | `BinaryToCbor/256` | 264 ns | 89.9 ns | 2.94× | + | `BinaryToCbor/32768` | 1.54 µs | 794 ns | 1.95× | + | `BinaryToCbor/32` | 248 ns | 49.4 ns | 5.02× | + | `BinaryToCbor/4096` | 399 ns | 169 ns | 2.36× | + | `BinaryToCbor/512` | 290 ns | 101 ns | 2.88× | + | `BinaryToCbor/64` | 247 ns | 82 ns | 3.01× | + | `BinaryToCbor/8192` | 507 ns | 249 ns | 2.04× | + | `BinaryToCbor/8` | 244 ns | 48.6 ns | 5.02× | + | `Copy/canada` | 3.6 ms | 2.84 ms | 1.27× | + | `Copy/citm_catalog` | 1.6 ms | 1.44 ms | 1.11× | + | `Copy/twitter` | 792 µs | 718 µs | 1.10× | + | `CopyAssign/canada` | 3.63 ms | 2.88 ms | 1.26× | + | `CopyAssign/citm_catalog` | 1.64 ms | 1.49 ms | 1.10× | + | `CopyAssign/twitter` | 799 µs | 735 µs | 1.09× | + | `CopyOnly/canada` | 1.51 ms | 1.49 ms | 1.01× | + | `CopyOnly/citm_catalog` | 733 µs | 782 µs | 0.94× | + | `CopyOnly/twitter` | 395 µs | 399 µs | 0.99× | + | `CopyRing/canada` | 3.64 ms | 2.88 ms | 1.27× | + | `CopyRing/citm_catalog` | 1.66 ms | 1.51 ms | 1.10× | + | `CopyRing/twitter` | 838 µs | 768 µs | 1.09× | + | `DestroyOnly/canada` | 2.1 ms | 1.36 ms | 1.55× | + | `DestroyOnly/citm_catalog` | 864 µs | 670 µs | 1.29× | + | `DestroyOnly/twitter` | 399 µs | 322 µs | 1.24× | + | `Diff/canada` | 37.5 ms | 3.67 ms | 10.2× | + | `Diff/citm_catalog` | 6.65 ms | 1.07 ms | 6.19× | + | `Diff/twitter` | 4.74 ms | 637 µs | 7.44× | + | `Dump/canada / -` | 6.63 ms | 2.25 ms | 2.94× | + | `Dump/canada / 4` | 8.7 ms | 2.98 ms | 2.92× | + | `Dump/citm_catalog / -` | 1.36 ms | 291 µs | 4.67× | + | `Dump/citm_catalog / 4` | 1.89 ms | 417 µs | 4.54× | + | `Dump/floats / -` | 62.3 ms | 23.2 ms | 2.68× | + | `Dump/floats / 4` | 70 ms | 24.1 ms | 2.90× | + | `Dump/jeopardy / -` | 201 ms | 29.9 ms | 6.73× | + | `Dump/jeopardy / 4` | 218 ms | 33.9 ms | 6.43× | + | `Dump/signed_ints / -` | 23.2 ms | 10.5 ms | 2.21× | + | `Dump/signed_ints / 4` | 31.5 ms | 11.1 ms | 2.84× | + | `Dump/small_signed_ints / -` | 17.5 ms | 7.83 ms | 2.24× | + | `Dump/small_signed_ints / 4` | 24.6 ms | 8.63 ms | 2.85× | + | `Dump/twitter / -` | 1.37 ms | 207 µs | 6.59× | + | `Dump/twitter / 4` | 1.55 ms | 249 µs | 6.24× | + | `Dump/unsigned_ints / -` | 23.1 ms | 7.94 ms | 2.92× | + | `Dump/unsigned_ints / 4` | 31.3 ms | 8.36 ms | 3.75× | + | `Equal/canada` | 451 µs | 332 µs | 1.36× | + | `Equal/citm_catalog` | 263 µs | 252 µs | 1.05× | + | `Equal/twitter` | 139 µs | 127 µs | 1.10× | + | `Flatten/canada` | 28 ms | 11 ms | 2.55× | + | `Flatten/citm_catalog` | 6.34 ms | 2.97 ms | 2.13× | + | `Flatten/twitter` | 3.45 ms | 2.01 ms | 1.72× | + | `FlattenOrdered/citm_catalog` | 249 ms | 1.37 ms | 181× | + | `FlattenOrdered/twitter` | 48.9 ms | 846 µs | 57.8× | + | `FromBinaryBuffer/bjdata / canada` | 8.13 ms | 4.08 ms | 1.99× | + | `FromBinaryBuffer/bjdata / twitter` | 3.07 ms | 948 µs | 3.24× | + | `FromBinaryBuffer/bjdata_optimized / canada` | 8.57 ms | 2.43 ms | 3.53× | + | `FromBinaryBuffer/bjdata_optimized / twitter` | 3.08 ms | 948 µs | 3.25× | + | `FromBinaryBuffer/bson / canada` | 9.32 ms | 4.25 ms | 2.19× | + | `FromBinaryBuffer/bson / citm_catalog` | 3.8 ms | 1.55 ms | 2.45× | + | `FromBinaryBuffer/bson / twitter` | 3.05 ms | 910 µs | 3.35× | + | `FromBinaryBuffer/cbor / canada` | 8.27 ms | 2.06 ms | 4.01× | + | `FromBinaryBuffer/cbor / citm_catalog` | 3.63 ms | 1.42 ms | 2.56× | + | `FromBinaryBuffer/cbor / floats` | 29 ms | 5.39 ms | 5.37× | + | `FromBinaryBuffer/cbor / jeopardy` | 355 ms | 112 ms | 3.18× | + | `FromBinaryBuffer/cbor / signed_ints` | 35 ms | 9.53 ms | 3.67× | + | `FromBinaryBuffer/cbor / twitter` | 3 ms | 942 µs | 3.18× | + | `FromBinaryBuffer/msgpack / canada` | 8.23 ms | 2.05 ms | 4.01× | + | `FromBinaryBuffer/msgpack / citm_catalog` | 3.68 ms | 1.4 ms | 2.63× | + | `FromBinaryBuffer/msgpack / jeopardy` | 352 ms | 107 ms | 3.28× | + | `FromBinaryBuffer/msgpack / twitter` | 2.98 ms | 921 µs | 3.24× | + | `FromBinaryBuffer/ubjson / canada` | 8.14 ms | 4.1 ms | 1.98× | + | `FromBinaryBuffer/ubjson / citm_catalog` | 3.76 ms | 1.71 ms | 2.19× | + | `FromBinaryBuffer/ubjson / jeopardy` | 363 ms | 112 ms | 3.24× | + | `FromBinaryBuffer/ubjson / twitter` | 3.08 ms | 945 µs | 3.26× | + | `FromBinaryBuffer/ubjson_optimized / canada` | 8.39 ms | 2.38 ms | 3.52× | + | `FromBinaryBuffer/ubjson_optimized / twitter` | 3.08 ms | 944 µs | 3.26× | + | `FromBinaryFile/bjdata / twitter` | 10.3 ms | 1.89 ms | 5.44× | + | `FromBinaryFile/bson / twitter` | 9.95 ms | 1.76 ms | 5.64× | + | `FromBinaryFile/cbor / canada` | 14 ms | 4.39 ms | 3.18× | + | `FromBinaryFile/cbor / twitter` | 9.66 ms | 1.51 ms | 6.41× | + | `FromBinaryFile/ubjson / canada` | 13.4 ms | 6.2 ms | 2.16× | + | `FromBinaryFile/ubjson / twitter` | 10.2 ms | 1.89 ms | 5.40× | + | `FromBinaryShape/containers / bjdata` | 14 ms | 6.96 ms | 2.02× | + | `FromBinaryShape/containers / bson` | 16.8 ms | 7.56 ms | 2.23× | + | `FromBinaryShape/containers / cbor` | 13.6 ms | 3.88 ms | 3.50× | + | `FromBinaryShape/containers / msgpack` | 13.5 ms | 3.82 ms | 3.53× | + | `FromBinaryShape/containers / ubjson_optimized` | 14.6 ms | 4.45 ms | 3.28× | + | `FromBinaryShape/containers / ubjson` | 14 ms | 6.98 ms | 2.01× | + | `FromBinaryShape/nested / bjdata` | 94.6 µs | 37.8 µs | 2.50× | + | `FromBinaryShape/nested / bson` | 101 µs | 41.4 µs | 2.43× | + | `FromBinaryShape/nested / cbor` | 92 µs | 37.3 µs | 2.47× | + | `FromBinaryShape/nested / msgpack` | 90.7 µs | 36.4 µs | 2.50× | + | `FromBinaryShape/nested / ubjson` | 94.5 µs | 37.9 µs | 2.49× | + | `FromBinaryShape/scalars / bjdata` | 24.2 ms | 11.2 ms | 2.15× | + | `FromBinaryShape/scalars / cbor` | 25 ms | 5.53 ms | 4.52× | + | `FromBinaryShape/scalars / msgpack` | 24 ms | 5.47 ms | 4.39× | + | `FromBinaryShape/scalars / ubjson` | 24.4 ms | 11.4 ms | 2.14× | + | `FromCborChunkedString/10000 chunks` | 89 µs | 81.6 µs | 1.09× | + | `FromMsgpack/canada` | 14 ms | 4.41 ms | 3.17× | + | `FromMsgpack/citm_catalog` | 8.79 ms | 2.22 ms | 3.96× | + | `FromMsgpack/floats` | 58.7 ms | 27.4 ms | 2.15× | + | `FromMsgpack/jeopardy` | 1,120 ms | 179 ms | 6.22× | + | `FromMsgpack/signed_ints` | 61.1 ms | 32.1 ms | 1.90× | + | `FromMsgpack/small_signed_ints` | 61.9 ms | 33.2 ms | 1.86× | + | `FromMsgpack/twitter` | 9.66 ms | 1.45 ms | 6.65× | + | `FromMsgpack/unsigned_ints` | 54.7 ms | 27.2 ms | 2.01× | + | `GetArray>` | 2.21 µs | 630 ns | 3.51× | + | `GetArray>` | 7.97 µs | 1.16 µs | 6.88× | + | `GetArray>` | 57.3 µs | 40.7 µs | 1.41× | + | `GetArray>` | 6.55 µs | 657 ns | 9.96× | + | `GetMap/citm_catalog` | 3.36 ms | 2.36 ms | 1.43× | + | `GetVectorDouble/floats` | 6.57 ms | 644 µs | 10.2× | + | `GetVectorInt/signed_ints` | 7.91 ms | 3.37 ms | 2.35× | + | `Iterate/canada` | 859 µs | 308 µs | 2.79× | + | `Iterate/citm_catalog` | 293 µs | 179 µs | 1.64× | + | `Iterate/twitter` | 85.9 µs | 61.5 µs | 1.40× | + | `JsonPointerAt/citm_catalog` | 1.8 ms | 1.11 ms | 1.63× | + | `JsonPointerAt/twitter` | 778 µs | 582 µs | 1.34× | + | `JsonPointerContains/citm_catalog` | 2.67 ms | 1.25 ms | 2.14× | + | `JsonPointerContains/twitter` | 1.27 ms | 610 µs | 2.09× | + | `JsonPointerParse/citm_catalog` | 5.61 ms | 2.17 ms | 2.59× | + | `JsonPointerParse/twitter` | 2.4 ms | 980 µs | 2.45× | + | `JsonPointerToString/citm_catalog` | 6.56 ms | 1.86 ms | 3.52× | + | `JsonPointerToString/twitter` | 2.15 ms | 795 µs | 2.70× | + | `ParseFILE/canada` | 51.8 ms | 13.8 ms | 3.74× | + | `ParseFILE/citm_catalog` | 34 ms | 7.25 ms | 4.70× | + | `ParseFILE/twitter` | 13.3 ms | 3.28 ms | 4.06× | + | `ParseFile/canada` | 17.2 ms | 6.2 ms | 2.78× | + | `ParseFile/citm_catalog` | 7.59 ms | 2.4 ms | 3.16× | + | `ParseFile/floats` | 127 ms | 47.2 ms | 2.68× | + | `ParseFile/jeopardy` | 320 ms | 156 ms | 2.06× | + | `ParseFile/signed_ints` | 123 ms | 44.9 ms | 2.75× | + | `ParseFile/small_signed_ints` | 62.2 ms | 32.5 ms | 1.91× | + | `ParseFile/twitter` | 3.29 ms | 1.34 ms | 2.46× | + | `ParseFile/unsigned_ints` | 119 ms | 46 ms | 2.59× | + | `ParseIndented/canada / 4` | 33.1 ms | 5.22 ms | 6.34× | + | `ParseIndented/citm_catalog / 4` | 7.15 ms | 1.76 ms | 4.06× | + | `ParseIndented/jeopardy / 4` | 330 ms | 130 ms | 2.54× | + | `ParseIndented/twitter / 4` | 3.53 ms | 1.09 ms | 3.24× | + | `ParseStreamValues/ndjson` | 6.99 ms | 3.7 ms | 1.89× | + | `ParseStreamValues/numbers` | 1.9 ms | 380 µs | 5.02× | + | `ParseString/canada` | 14.8 ms | 4.48 ms | 3.31× | + | `ParseString/citm_catalog` | 7.16 ms | 1.76 ms | 4.07× | + | `ParseString/floats` | 117 ms | 28.6 ms | 4.09× | + | `ParseString/jeopardy` | 297 ms | 127 ms | 2.34× | + | `ParseString/signed_ints` | 118 ms | 31 ms | 3.80× | + | `ParseString/small_signed_ints` | 60.2 ms | 24 ms | 2.51× | + | `ParseString/twitter` | 3.14 ms | 1.03 ms | 3.06× | + | `ParseString/unsigned_ints` | 117 ms | 32.2 ms | 3.64× | + | `ParseStringOrdered/canada` | 14.9 ms | 4.37 ms | 3.40× | + | `ParseStringOrdered/citm_catalog` | 10.7 ms | 1.63 ms | 6.52× | + | `ParseStringOrdered/jeopardy` | 356 ms | 110 ms | 3.24× | + | `ParseStringOrdered/twitter` | 4.3 ms | 903 µs | 4.76× | + | `Patch/canada` | 9.91 ms | 3.33 ms | 2.97× | + | `Patch/citm_catalog` | 2.49 ms | 1.6 ms | 1.55× | + | `Patch/twitter` | 1.44 ms | 846 µs | 1.70× | + | `SaxParse/canada` | 12.7 ms | 3.18 ms | 3.98× | + | `SaxParse/citm_catalog` | 6.3 ms | 948 µs | 6.64× | + | `SaxParse/twitter` | 2.44 ms | 471 µs | 5.18× | + | `ToCbor/canada` | 1.36 ms | 546 µs | 2.49× | + | `ToCbor/citm_catalog` | 1.01 ms | 256 µs | 3.93× | + | `ToCbor/floats` | 8.79 ms | 1.88 ms | 4.69× | + | `ToCbor/jeopardy` | 70.8 ms | 21.2 ms | 3.35× | + | `ToCbor/signed_ints` | 11.2 ms | 2.74 ms | 4.07× | + | `ToCbor/small_signed_ints` | 10.1 ms | 2.37 ms | 4.25× | + | `ToCbor/twitter` | 625 µs | 145 µs | 4.30× | + | `ToCbor/unsigned_ints` | 7.92 ms | 2.75 ms | 2.88× | + | `ToJsonStrings/copy` | 5.77 ms | 5.52 ms | 1.04× | + | `ToJsonStrings/move` | 5.77 ms | 3.02 ms | 1.91× | + | `Unflatten/canada` | 40.5 ms | 10.7 ms | 3.79× | + | `Unflatten/citm_catalog` | 9.52 ms | 3.42 ms | 2.78× | + | `Unflatten/twitter` | 4.47 ms | 2.08 ms | 2.15× | ### C. The timeline @@ -1765,15 +1766,15 @@ one binary with six code layouts: they were equal within 0.2 %. | operation | 3.12.0 | 3.13.0 | speedup | cause | PR | | --- | --: | --: | --: | --- | --- | -| `diff()` of an array of 64,000 numbers against an empty array | 4,101 ms | 10.1 ms | 406× | each `remove` was inserted at the front of the patch | [#5461][5461] | -| `diff()` of an array of 20,000 objects against every second one of them | 119 ms | 3.83 ms | 31× | the same | [#5461][5461] | -| `parse()` with a callback that rejects half of 32,000 objects | 1,348 ms | 11.5 ms | 117× | each rejected value was searched for from the start of its parent | [#5457][5457] | -| `<` on two equal values nested 24 levels deep (C++11 to C++17) | 63.6 ms | 0.002 ms | exponential | `std::vector`'s `<` asks `a < b` and `b < a`, and both recurse | [#5390][5390] | -| `<` on `citm_catalog.json` and a copy, 10× (C++11 to C++17) | 273 ms | 3.80 ms | 72× | the same | [#5390][5390] | +| `diff()` of an array of 64,000 numbers against an empty array | 4,113 ms | 10.1 ms | 408× | each `remove` was inserted at the front of the patch | [#5461][5461] | +| `diff()` of an array of 20,000 objects against every second one of them | 119 ms | 3.90 ms | 30× | the same | [#5461][5461] | +| `parse()` with a callback that rejects half of 32,000 objects | 1,363 ms | 11.5 ms | 119× | each rejected value was searched for from the start of its parent | [#5457][5457] | +| `<` on two equal values nested 24 levels deep (C++11 to C++17) | 63.7 ms | 0.002 ms | exponential | `std::vector`'s `<` asks `a < b` and `b < a`, and both recurse | [#5390][5390] | +| `<` on `citm_catalog.json` and a copy, 10× (C++11 to C++17) | 274 ms | 3.83 ms | 72× | the same | [#5390][5390] | | `flatten()` of `citm_catalog.json` as `ordered_json` | 253 ms | 1.37 ms | 184× | every new key was looked up linearly | [#5834][5834] | -| `to_bson()` of a value nested 200 levels deep, 100× | 19.5 ms | 0.357 ms | 55× | each document's size was computed by walking everything below it again | [#5553][5553], [#5979][5979] | -| 100,000 × `push_back()` on an `ordered_json` with [`JSON_DIAGNOSTICS`](../../api/macros/json_diagnostics.md) | 1,525 ms | 5.14 ms | 297× | every insert re-pointed the parent pointers of all elements | [#5832][5832] | -| 10,000 × `at(i)` on an `ordered_json` array with `JSON_DIAGNOSTICS` | 43.9 ms | 0.080 ms | 548× | the same | [#5832][5832] | +| `to_bson()` of a value nested 200 levels deep, 100× | 19.8 ms | 0.352 ms | 56× | each document's size was computed by walking everything below it again | [#5553][5553], [#5979][5979] | +| 100,000 × `push_back()` on an `ordered_json` with [`JSON_DIAGNOSTICS`](../../api/macros/json_diagnostics.md) | 1,541 ms | 5.11 ms | 301× | every insert re-pointed the parent pointers of all elements | [#5832][5832] | +| 10,000 × `at(i)` on an `ordered_json` array with `JSON_DIAGNOSTICS` | 44.0 ms | 0.084 ms | 523× | the same | [#5832][5832] |

Operations that were quadratic or worse in 3.12.0, timed with both versions (C++17, `-O3`, median of 3 interleaved runs).

@@ -2257,7 +2258,7 @@ removed because 3.12.0 has no BON8. | compiler | Apple clang 21, libc++ | | flags | `-O3 -flto -DNDEBUG`, the compiler's default standard, C++14 | | suite | 2 rounds × 4 repetitions per version, random interleaving, each round of a version started only when the load average was below 4 and repeated when it rose above 5 while running; the median of all 8 | -| noise | the coefficient of variation was 3 % or less for 180 of the 182 rows with 3.12.0 and 177 with 3.13.0; the largest was 5 % | +| noise | the coefficient of variation was 3 % or less for 178 of the 182 rows with 3.12.0 and 177 with 3.13.0; the largest was 6.5 %, not counting one 3.13.0 run that a disturbance made 2.7× as slow | | inputs | the files of [Appendix A](#a-test-files), and number-heavy files |

Setup of the Google Benchmark comparison of 3.12.0 and 3.13.0.

diff --git a/docs/mkdocs/docs/images/perf_blog_cliffs.svg b/docs/mkdocs/docs/images/perf_blog_cliffs.svg index c9d3c0d11..01c26fcc7 100644 --- a/docs/mkdocs/docs/images/perf_blog_cliffs.svg +++ b/docs/mkdocs/docs/images/perf_blog_cliffs.svg @@ -1,6 +1,6 @@ Operations that grew quadratically or worse: time with 3.12.0 and 3.13.0, log scale -Dot plot on a logarithmic time axis, less is better; an arrow leads from each 3.12.0 time to the 3.13.0 time. diff() 64k numbers vs []: 4101 ms to 10.1 ms; diff() 20k objects vs half: 119 ms to 3.83 ms; parse() callback, 32k objects: 1348 ms to 11.5 ms; operator< nested 24 deep: 63.6 ms to 0.002 ms; operator< citm, 10x: 273 ms to 3.8 ms; flatten() citm, ordered_json: 253 ms to 1.37 ms; to_bson() 200 deep, 100x: 19.5 ms to 0.357 ms; push_back() 100k, diagnostics: 1525 ms to 5.14 ms; at(i) 10k, diagnostics: 43.9 ms to 0.08 ms. +Dot plot on a logarithmic time axis, less is better; an arrow leads from each 3.12.0 time to the 3.13.0 time. diff() 64k numbers vs []: 4113 ms to 10.1 ms; diff() 20k objects vs half: 119 ms to 3.9 ms; parse() callback, 32k objects: 1363 ms to 11.5 ms; operator< nested 24 deep: 63.7 ms to 0.002 ms; operator< citm, 10x: 274 ms to 3.83 ms; flatten() citm, ordered_json: 253 ms to 1.37 ms; to_bson() 200 deep, 100x: 19.8 ms to 0.352 ms; push_back() 100k, diagnostics: 1541 ms to 5.11 ms; at(i) 10k, diagnostics: 44 ms to 0.084 ms. 1 µs @@ -22,48 +22,48 @@ 3.12.0 3.13.0 diff() 64k numbers vs [] - -diff() 64k numbers vs [], 3.12.0: 4101 ms + +diff() 64k numbers vs [], 3.12.0: 4113 ms diff() 64k numbers vs [], 3.13.0: 10.1 ms -406× +407× diff() 20k objects vs half - + diff() 20k objects vs half, 3.12.0: 119 ms -diff() 20k objects vs half, 3.13.0: 3.83 ms -31× +diff() 20k objects vs half, 3.13.0: 3.9 ms +31× parse() callback, 32k objects - -parse() callback, 32k objects, 3.12.0: 1348 ms + +parse() callback, 32k objects, 3.12.0: 1363 ms parse() callback, 32k objects, 3.13.0: 11.5 ms -117× +119× operator< nested 24 deep - -operator< nested 24 deep, 3.12.0: 63.6 ms + +operator< nested 24 deep, 3.12.0: 63.7 ms operator< nested 24 deep, 3.13.0: 0.002 ms -31800× +31850× operator< citm, 10x - -operator< citm, 10x, 3.12.0: 273 ms -operator< citm, 10x, 3.13.0: 3.8 ms -72× + +operator< citm, 10x, 3.12.0: 274 ms +operator< citm, 10x, 3.13.0: 3.83 ms +72× flatten() citm, ordered_json flatten() citm, ordered_json, 3.12.0: 253 ms flatten() citm, ordered_json, 3.13.0: 1.37 ms 185× to_bson() 200 deep, 100x - -to_bson() 200 deep, 100x, 3.12.0: 19.5 ms -to_bson() 200 deep, 100x, 3.13.0: 0.357 ms -55× + +to_bson() 200 deep, 100x, 3.12.0: 19.8 ms +to_bson() 200 deep, 100x, 3.13.0: 0.352 ms +56× push_back() 100k, diagnostics - -push_back() 100k, diagnostics, 3.12.0: 1525 ms -push_back() 100k, diagnostics, 3.13.0: 5.14 ms -297× + +push_back() 100k, diagnostics, 3.12.0: 1541 ms +push_back() 100k, diagnostics, 3.13.0: 5.11 ms +302× at(i) 10k, diagnostics - -at(i) 10k, diagnostics, 3.12.0: 43.9 ms -at(i) 10k, diagnostics, 3.13.0: 0.08 ms -549× + +at(i) 10k, diagnostics, 3.12.0: 44 ms +at(i) 10k, diagnostics, 3.13.0: 0.084 ms +524× diff --git a/docs/mkdocs/docs/images/perf_blog_distribution.svg b/docs/mkdocs/docs/images/perf_blog_distribution.svg index d40ca1a54..0bbc13892 100644 --- a/docs/mkdocs/docs/images/perf_blog_distribution.svg +++ b/docs/mkdocs/docs/images/perf_blog_distribution.svg @@ -1,6 +1,6 @@ Speedup of 3.13.0 over 3.12.0 for all 182 benchmarks of the suite -Bars counting the benchmarks per speedup range: below 1x: 1; 1 to 1.5x: 22; 1.5 to 2x: 15; 2 to 3x: 57; 3 to 5x: 57; 5 to 10x: 25; 10x or more: 5. Median 2.9x, geometric mean 3.0x. +Bars counting the benchmarks per speedup range: below 1x: 2; 1 to 1.5x: 21; 1.5 to 2x: 14; 2 to 3x: 58; 3 to 5x: 57; 5 to 10x: 26; 10x or more: 4. Median 2.9x, geometric mean 3.0x. 0 @@ -9,26 +9,26 @@ 40 60 -below 1×: 1 -1 +below 1×: 2 +2 below 1× -1 to 1.5×: 22 -22 +1 to 1.5×: 21 +21 1 to 1.5× -1.5 to 2×: 15 -15 +1.5 to 2×: 14 +14 1.5 to 2× -2 to 3×: 57 -57 +2 to 3×: 58 +58 2 to 3× 3 to 5×: 57 57 3 to 5× -5 to 10×: 25 -25 +5 to 10×: 26 +26 5 to 10× -10× or more: 5 -5 +10× or more: 4 +4 10× or more speedup over 3.12.0, more is better diff --git a/docs/mkdocs/docs/images/perf_blog_overview.svg b/docs/mkdocs/docs/images/perf_blog_overview.svg index b5f75494f..6e74d0b5c 100644 --- a/docs/mkdocs/docs/images/perf_blog_overview.svg +++ b/docs/mkdocs/docs/images/perf_blog_overview.svg @@ -1,6 +1,6 @@ Speedup of 3.13.0 over 3.12.0 per workload, Apple M1 Max, Apple clang -Horizontal bars of the speedup, more is better. twitter.json 3.1x; citm_catalog.json 4.2x; canada.json 3.5x; canada.json, indented 6.6x; citm, ordered_json 6.7x; twitter, std::ifstream 2.4x; citm, FILE* 4.7x; citm, accept() 7.6x; dump() twitter 6.7x; dump() canada 2.9x; dump(4) citm 4.6x; to_cbor() twitter 4.5x; twitter, memory 3.2x; twitter, FILE* 6.5x; diff() canada 10x; iterate canada 2.7x; copy + destroy citm 1.11x; == citm 1.07x. +Horizontal bars of the speedup, more is better. twitter.json 3.1x; citm_catalog.json 4.1x; canada.json 3.3x; canada.json, indented 6.3x; citm, ordered_json 6.5x; twitter, std::ifstream 2.5x; citm, FILE* 4.7x; citm, accept() 7.0x; dump() twitter 6.6x; dump() canada 2.9x; dump(4) citm 4.5x; to_cbor() twitter 4.3x; twitter, memory 3.2x; twitter, FILE* 6.4x; diff() canada 10x; iterate canada 2.8x; copy + destroy citm 1.11x; == citm 1.05x. Parsing Writing Reading C​BOR @@ -28,59 +28,59 @@ 11× twitter.json -twitter.json: 3.1× -3.1× +twitter.json: 3.1× +3.1× citm_catalog.json -citm_catalog.json: 4.2× -4.2× +citm_catalog.json: 4.1× +4.1× canada.json -canada.json: 3.5× -3.5× +canada.json: 3.3× +3.3× canada.json, indented -canada.json, indented: 6.6× -6.6× +canada.json, indented: 6.3× +6.3× citm, ordered_json -citm, ordered_json: 6.7× -6.7× +citm, ordered_json: 6.5× +6.5× twitter, std::ifstream -twitter, std::ifstream: 2.4× -2.4× +twitter, std::ifstream: 2.5× +2.5× citm, FILE* -citm, FILE*: 4.7× -4.7× +citm, FILE*: 4.7× +4.7× citm, accept() -citm, accept(): 7.6× -7.6× +citm, accept(): 7.0× +7.0× dump() twitter -dump() twitter: 6.7× -6.7× +dump() twitter: 6.6× +6.6× dump() canada -dump() canada: 2.9× -2.9× +dump() canada: 2.9× +2.9× dump(4) citm -dump(4) citm: 4.6× -4.6× +dump(4) citm: 4.5× +4.5× to_cbor() twitter -to_cbor() twitter: 4.5× -4.5× +to_cbor() twitter: 4.3× +4.3× twitter, memory -twitter, memory: 3.2× -3.2× +twitter, memory: 3.2× +3.2× twitter, FILE* -twitter, FILE*: 6.5× -6.5× +twitter, FILE*: 6.4× +6.4× diff() canada -diff() canada: 10× -10× +diff() canada: 10× +10× iterate canada -iterate canada: 2.7× -2.7× +iterate canada: 2.8× +2.8× copy + destroy citm copy + destroy citm: 1.11× 1.11× == citm -== citm: 1.07× -1.07× +== citm: 1.05× +1.05× speedup over 3.12.0 (3.12.0 = 1×), more is better diff --git a/docs/mkdocs/docs/images/perf_blog_timeline_accept_twitter.svg b/docs/mkdocs/docs/images/perf_blog_timeline_accept_twitter.svg index 477450d7f..45a1c7eec 100644 --- a/docs/mkdocs/docs/images/perf_blog_timeline_accept_twitter.svg +++ b/docs/mkdocs/docs/images/perf_blog_timeline_accept_twitter.svg @@ -16,7 +16,7 @@ Sep 2026 Oct - + #5234: 1.22× diff --git a/docs/mkdocs/docs/images/perf_blog_timeline_dump_canada.svg b/docs/mkdocs/docs/images/perf_blog_timeline_dump_canada.svg index 80ca8a14f..766bfa607 100644 --- a/docs/mkdocs/docs/images/perf_blog_timeline_dump_canada.svg +++ b/docs/mkdocs/docs/images/perf_blog_timeline_dump_canada.svg @@ -16,7 +16,7 @@ Sep 2026 Oct - + #5285: 1.09× diff --git a/docs/mkdocs/docs/images/perf_blog_timeline_dump_twitter.svg b/docs/mkdocs/docs/images/perf_blog_timeline_dump_twitter.svg index 69179234b..41e63537d 100644 --- a/docs/mkdocs/docs/images/perf_blog_timeline_dump_twitter.svg +++ b/docs/mkdocs/docs/images/perf_blog_timeline_dump_twitter.svg @@ -1,6 +1,6 @@ dump() twitter.json: speedup over 3.12.0 by commit -dump() twitter.json: speedup over 3.12.0 at each of 317 commits, ending at 6.7x. Labeled steps, by theme: 6, 2, 2, 2. +dump() twitter.json: speedup over 3.12.0 at each of 317 commits, ending at 6.8x. Labeled steps, by theme: 6, 2, 2, 2. dump() twitter.json 1× @@ -18,7 +18,7 @@ Sep 2026 Oct - + #5285: 3.3× diff --git a/docs/mkdocs/docs/images/perf_blog_timeline_from_cbor_twitter.svg b/docs/mkdocs/docs/images/perf_blog_timeline_from_cbor_twitter.svg index 4e555fc0c..9823fe941 100644 --- a/docs/mkdocs/docs/images/perf_blog_timeline_from_cbor_twitter.svg +++ b/docs/mkdocs/docs/images/perf_blog_timeline_from_cbor_twitter.svg @@ -1,6 +1,6 @@ from_cbor() twitter: speedup over 3.12.0 by commit -from_cbor() twitter: speedup over 3.12.0 at each of 317 commits, ending at 2.6x. Labeled steps, by theme: 1, 4, U, U. +from_cbor() twitter: speedup over 3.12.0 at each of 317 commits, ending at 2.7x. Labeled steps, by theme: 1, 4, U, U. from_cbor() twitter 1× @@ -14,7 +14,7 @@ Sep 2026 Oct - + #5233: 1.47× diff --git a/docs/mkdocs/docs/images/perf_blog_timeline_parse_canada.svg b/docs/mkdocs/docs/images/perf_blog_timeline_parse_canada.svg index ad7494047..f4e96a3f9 100644 --- a/docs/mkdocs/docs/images/perf_blog_timeline_parse_canada.svg +++ b/docs/mkdocs/docs/images/perf_blog_timeline_parse_canada.svg @@ -1,6 +1,6 @@ parse() canada.json: speedup over 3.12.0 by commit -parse() canada.json: speedup over 3.12.0 at each of 317 commits, ending at 2.9x. Labeled steps, by theme: 4, 1, 3, 3, 3, 4. +parse() canada.json: speedup over 3.12.0 at each of 317 commits, ending at 2.8x. Labeled steps, by theme: 4, 1, 3, 3, 3, 4. parse() canada.json 1× @@ -14,7 +14,7 @@ Sep 2026 Oct - + #5234: 1.11× diff --git a/docs/mkdocs/docs/images/perf_blog_timeline_parse_citm.svg b/docs/mkdocs/docs/images/perf_blog_timeline_parse_citm.svg index 2c8eb820e..4c1d43cf8 100644 --- a/docs/mkdocs/docs/images/perf_blog_timeline_parse_citm.svg +++ b/docs/mkdocs/docs/images/perf_blog_timeline_parse_citm.svg @@ -16,7 +16,7 @@ Sep 2026 Oct - + #5234: 1.55× diff --git a/docs/mkdocs/docs/images/perf_blog_timeline_parse_twitter_ifstream.svg b/docs/mkdocs/docs/images/perf_blog_timeline_parse_twitter_ifstream.svg index 00b9824b7..3561c832f 100644 --- a/docs/mkdocs/docs/images/perf_blog_timeline_parse_twitter_ifstream.svg +++ b/docs/mkdocs/docs/images/perf_blog_timeline_parse_twitter_ifstream.svg @@ -1,6 +1,6 @@ parse() twitter.json, std::ifstream: speedup over 3.12.0 by commit -parse() twitter.json, std::ifstream: speedup over 3.12.0 at each of 317 commits, ending at 2.2x. Labeled steps, by theme: 1, 1. +parse() twitter.json, std::ifstream: speedup over 3.12.0 at each of 317 commits, ending at 2.3x. Labeled steps, by theme: 1, 1. parse() twitter.json, std::ifstream 1× @@ -14,7 +14,7 @@ Sep 2026 Oct - + #5828: 1.97× diff --git a/docs/mkdocs/docs/images/perf_blog_timeline_to_cbor_twitter.svg b/docs/mkdocs/docs/images/perf_blog_timeline_to_cbor_twitter.svg index 20a940211..e6b5062e5 100644 --- a/docs/mkdocs/docs/images/perf_blog_timeline_to_cbor_twitter.svg +++ b/docs/mkdocs/docs/images/perf_blog_timeline_to_cbor_twitter.svg @@ -16,7 +16,7 @@ Sep 2026 Oct - + #5328: 2.2× diff --git a/docs/mkdocs/scripts/figures/data/perf_suite.csv b/docs/mkdocs/scripts/figures/data/perf_suite.csv index faa7d9e5e..af16119e8 100644 --- a/docs/mkdocs/scripts/figures/data/perf_suite.csv +++ b/docs/mkdocs/scripts/figures/data/perf_suite.csv @@ -1,183 +1,183 @@ benchmark,unit,3.12.0,3.13.0,speedup -Accept/canada,ns,1.26696e+07,2.2575e+06,5.612 -Accept/citm_catalog,ns,6.27254e+06,821823,7.632 -Accept/floats,ns,1.13006e+08,2.40221e+07,4.704 -Accept/jeopardy,ns,2.17632e+08,5.58138e+07,3.899 -Accept/signed_ints,ns,1.12907e+08,2.85756e+07,3.951 -Accept/small_signed_ints,ns,5.54714e+07,1.8795e+07,2.951 -Accept/twitter,ns,2.43838e+06,473586,5.149 -Accept/unsigned_ints,ns,1.1346e+08,2.74621e+07,4.132 -BinaryToCbor/1024,ns,297.407,99.5768,2.987 -BinaryToCbor/128,ns,248.439,111.657,2.225 -BinaryToCbor/16,ns,242.564,47.7818,5.077 -BinaryToCbor/16384,ns,973.398,399.499,2.437 -BinaryToCbor/2048,ns,319.624,118.272,2.702 -BinaryToCbor/256,ns,266.104,87.3165,3.048 -BinaryToCbor/32,ns,247.978,48.4634,5.117 -BinaryToCbor/32768,ns,1556.18,800.873,1.943 -BinaryToCbor/4096,ns,396.295,162.602,2.437 -BinaryToCbor/512,ns,285.575,96.0648,2.973 -BinaryToCbor/64,ns,250.377,81.925,3.056 -BinaryToCbor/8,ns,244.156,47.288,5.163 -BinaryToCbor/8192,ns,504.281,243.911,2.067 -Copy/canada,ns,3.63446e+06,2.82189e+06,1.288 -Copy/citm_catalog,ns,1.60912e+06,1.44486e+06,1.114 -Copy/twitter,ns,795454,713137,1.115 -CopyAssign/canada,ns,3.67193e+06,2.83735e+06,1.294 -CopyAssign/citm_catalog,ns,1.6226e+06,1.46761e+06,1.106 -CopyAssign/twitter,ns,796879,723802,1.101 -CopyOnly/canada,ns,1.515e+06,1.48013e+06,1.024 -CopyOnly/citm_catalog,ns,735909,779064,0.945 -CopyOnly/twitter,ns,396091,394148,1.005 -CopyRing/canada,ns,3.6601e+06,2.87591e+06,1.273 -CopyRing/citm_catalog,ns,1.67396e+06,1.49385e+06,1.121 -CopyRing/twitter,ns,852203,758099,1.124 -DestroyOnly/canada,ns,2.11222e+06,1.34774e+06,1.567 -DestroyOnly/citm_catalog,ns,877627,665344,1.319 -DestroyOnly/twitter,ns,401389,318049,1.262 -Diff/canada,ns,3.79246e+07,3.63624e+06,10.430 -Diff/citm_catalog,ns,6.67077e+06,1.06338e+06,6.273 -Diff/twitter,ns,4.77939e+06,625756,7.638 -Dump/canada / -,ns,6.59487e+06,2.2613e+06,2.916 -Dump/canada / 4,ns,8.74176e+06,2.97842e+06,2.935 -Dump/citm_catalog / -,ns,1.3644e+06,288719,4.726 -Dump/citm_catalog / 4,ns,1.89619e+06,413366,4.587 -Dump/floats / -,ns,6.19828e+07,2.32629e+07,2.664 -Dump/floats / 4,ns,6.99509e+07,2.42733e+07,2.882 -Dump/jeopardy / -,ns,1.98646e+08,3.00149e+07,6.618 -Dump/jeopardy / 4,ns,2.1766e+08,3.41791e+07,6.368 -Dump/signed_ints / -,ns,2.34589e+07,1.04283e+07,2.250 -Dump/signed_ints / 4,ns,3.14953e+07,1.10449e+07,2.852 -Dump/small_signed_ints / -,ns,1.75382e+07,7.78445e+06,2.253 -Dump/small_signed_ints / 4,ns,2.45961e+07,8.6025e+06,2.859 -Dump/twitter / -,ns,1.37764e+06,206071,6.685 -Dump/twitter / 4,ns,1.55081e+06,245319,6.322 -Dump/unsigned_ints / -,ns,2.32299e+07,7.88898e+06,2.945 -Dump/unsigned_ints / 4,ns,3.13409e+07,8.36799e+06,3.745 -Equal/canada,ns,453424,327263,1.386 -Equal/citm_catalog,ns,266993,250294,1.067 -Equal/twitter,ns,139736,125746,1.111 -Flatten/canada,ns,2.82338e+07,1.08847e+07,2.594 -Flatten/citm_catalog,ns,6.30735e+06,3.00812e+06,2.097 -Flatten/twitter,ns,3.47237e+06,2.01096e+06,1.727 -FlattenOrdered/citm_catalog,ns,2.51117e+08,1.37356e+06,182.822 -FlattenOrdered/twitter,ns,4.80472e+07,845690,56.814 -FromBinaryBuffer/bjdata / canada,ns,8.06626e+06,4.09343e+06,1.971 -FromBinaryBuffer/bjdata / twitter,ns,3.10065e+06,945348,3.280 -FromBinaryBuffer/bjdata_optimized / canada,ns,8.55835e+06,2.4023e+06,3.563 -FromBinaryBuffer/bjdata_optimized / twitter,ns,3.07733e+06,941691,3.268 -FromBinaryBuffer/bson / canada,ns,9.21459e+06,4.26414e+06,2.161 -FromBinaryBuffer/bson / citm_catalog,ns,3.83754e+06,1.59156e+06,2.411 -FromBinaryBuffer/bson / twitter,ns,3.04999e+06,914475,3.335 -FromBinaryBuffer/cbor / canada,ns,8.24692e+06,2.10045e+06,3.926 -FromBinaryBuffer/cbor / citm_catalog,ns,3.67001e+06,1.40559e+06,2.611 -FromBinaryBuffer/cbor / floats,ns,2.88379e+07,5.54206e+06,5.203 -FromBinaryBuffer/cbor / jeopardy,ns,3.55185e+08,1.12369e+08,3.161 -FromBinaryBuffer/cbor / signed_ints,ns,3.50877e+07,1.06246e+07,3.302 -FromBinaryBuffer/cbor / twitter,ns,3.02882e+06,938435,3.228 -FromBinaryBuffer/msgpack / canada,ns,8.1874e+06,2.10574e+06,3.888 -FromBinaryBuffer/msgpack / citm_catalog,ns,3.69114e+06,1.38675e+06,2.662 -FromBinaryBuffer/msgpack / jeopardy,ns,3.48804e+08,1.07752e+08,3.237 -FromBinaryBuffer/msgpack / twitter,ns,3.00307e+06,918949,3.268 -FromBinaryBuffer/ubjson / canada,ns,8.07635e+06,4.10295e+06,1.968 -FromBinaryBuffer/ubjson / citm_catalog,ns,3.81009e+06,1.73556e+06,2.195 -FromBinaryBuffer/ubjson / jeopardy,ns,3.68321e+08,1.13364e+08,3.249 -FromBinaryBuffer/ubjson / twitter,ns,3.11341e+06,948522,3.282 -FromBinaryBuffer/ubjson_optimized / canada,ns,8.35104e+06,2.36581e+06,3.530 -FromBinaryBuffer/ubjson_optimized / twitter,ns,3.06434e+06,938610,3.265 -FromBinaryFile/bjdata / twitter,ns,1.01717e+07,1.88288e+06,5.402 -FromBinaryFile/bson / twitter,ns,1.00323e+07,1.7507e+06,5.730 -FromBinaryFile/cbor / canada,ns,1.40561e+07,4.33636e+06,3.241 -FromBinaryFile/cbor / twitter,ns,9.76788e+06,1.50363e+06,6.496 -FromBinaryFile/ubjson / canada,ns,1.33567e+07,6.24716e+06,2.138 -FromBinaryFile/ubjson / twitter,ns,1.02704e+07,1.88515e+06,5.448 -FromBinaryShape/containers / bjdata,ns,1.39728e+07,6.97745e+06,2.003 -FromBinaryShape/containers / bson,ns,1.66944e+07,7.57557e+06,2.204 -FromBinaryShape/containers / cbor,ns,1.37656e+07,3.92529e+06,3.507 -FromBinaryShape/containers / msgpack,ns,1.36795e+07,3.873e+06,3.532 -FromBinaryShape/containers / ubjson,ns,1.39033e+07,6.94785e+06,2.001 -FromBinaryShape/containers / ubjson_optimized,ns,1.45005e+07,4.4374e+06,3.268 -FromBinaryShape/nested / bjdata,ns,94734.2,37641.8,2.517 -FromBinaryShape/nested / bson,ns,100822,41783.2,2.413 -FromBinaryShape/nested / cbor,ns,92458.3,35251.3,2.623 -FromBinaryShape/nested / msgpack,ns,91071.5,34781.9,2.618 -FromBinaryShape/nested / ubjson,ns,93738.5,37564.7,2.495 -FromBinaryShape/scalars / bjdata,ns,2.41928e+07,1.11786e+07,2.164 -FromBinaryShape/scalars / cbor,ns,2.53634e+07,5.77218e+06,4.394 -FromBinaryShape/scalars / msgpack,ns,2.40515e+07,5.69592e+06,4.223 -FromBinaryShape/scalars / ubjson,ns,2.43914e+07,1.12377e+07,2.171 -FromCborChunkedString/10000 chunks,ns,89766.6,81082.5,1.107 -FromMsgpack/canada,ns,1.39115e+07,4.36091e+06,3.190 -FromMsgpack/citm_catalog,ns,8.78364e+06,2.19066e+06,4.010 -FromMsgpack/floats,ns,5.88697e+07,2.716e+07,2.168 -FromMsgpack/jeopardy,ns,1.1169e+09,1.78518e+08,6.257 -FromMsgpack/signed_ints,ns,6.18791e+07,3.19405e+07,1.937 -FromMsgpack/small_signed_ints,ns,6.17411e+07,3.32716e+07,1.856 -FromMsgpack/twitter,ns,9.71057e+06,1.43151e+06,6.783 -FromMsgpack/unsigned_ints,ns,5.46656e+07,2.73563e+07,1.998 -"GetArray>",ns,2226.89,628.823,3.541 -GetArray>,ns,7987.51,1154.72,6.917 -GetArray>,ns,58292.1,41015.3,1.421 -GetArray>,ns,6583.86,654.896,10.053 -GetMap/citm_catalog,ns,3.37868e+06,2.38201e+06,1.418 -GetVectorDouble/floats,ns,6.55968e+06,638337,10.276 -GetVectorInt/signed_ints,ns,7.93082e+06,3.36672e+06,2.356 -Iterate/canada,ns,863030,319612,2.700 -Iterate/citm_catalog,ns,294667,165042,1.785 -Iterate/twitter,ns,86187.1,61998.9,1.390 -JsonPointerAt/citm_catalog,ns,1.79511e+06,1.10986e+06,1.617 -JsonPointerAt/twitter,ns,783457,577673,1.356 -JsonPointerContains/citm_catalog,ns,2.67654e+06,1.2123e+06,2.208 -JsonPointerContains/twitter,ns,1.27533e+06,600836,2.123 -JsonPointerParse/citm_catalog,ns,5.63099e+06,2.14907e+06,2.620 -JsonPointerParse/twitter,ns,2.41845e+06,981978,2.463 -JsonPointerToString/citm_catalog,ns,6.61402e+06,1.85736e+06,3.561 -JsonPointerToString/twitter,ns,2.16657e+06,789775,2.743 -ParseFILE/canada,ns,5.2126e+07,1.38733e+07,3.757 -ParseFILE/citm_catalog,ns,3.4268e+07,7.25874e+06,4.721 -ParseFILE/twitter,ns,1.33521e+07,3.2647e+06,4.090 -ParseFile/canada,ns,1.72435e+07,6.07983e+06,2.836 -ParseFile/citm_catalog,ns,7.64894e+06,2.38641e+06,3.205 -ParseFile/floats,ns,1.27024e+08,4.70746e+07,2.698 -ParseFile/jeopardy,ns,3.24619e+08,1.58029e+08,2.054 -ParseFile/signed_ints,ns,1.24305e+08,4.5808e+07,2.714 -ParseFile/small_signed_ints,ns,6.28615e+07,3.16401e+07,1.987 -ParseFile/twitter,ns,3.2765e+06,1.34371e+06,2.438 -ParseFile/unsigned_ints,ns,1.20124e+08,4.40035e+07,2.730 -ParseIndented/canada / 4,ns,3.31005e+07,5.04112e+06,6.566 -ParseIndented/citm_catalog / 4,ns,7.11787e+06,1.73917e+06,4.093 -ParseIndented/jeopardy / 4,ns,3.33132e+08,1.29074e+08,2.581 -ParseIndented/twitter / 4,ns,3.57115e+06,1.09089e+06,3.274 -ParseStreamValues/ndjson,ns,6.97026e+06,3.70937e+06,1.879 -ParseStreamValues/numbers,ns,1.8966e+06,373744,5.075 -ParseString/canada,ns,1.50132e+07,4.35565e+06,3.447 -ParseString/citm_catalog,ns,7.26397e+06,1.73446e+06,4.188 -ParseString/floats,ns,1.1698e+08,3.02859e+07,3.863 -ParseString/jeopardy,ns,3.05106e+08,1.28063e+08,2.382 -ParseString/signed_ints,ns,1.19046e+08,3.16406e+07,3.762 -ParseString/small_signed_ints,ns,5.97047e+07,2.20096e+07,2.713 -ParseString/twitter,ns,3.18359e+06,1.02841e+06,3.096 -ParseString/unsigned_ints,ns,1.18153e+08,3.03899e+07,3.888 -ParseStringOrdered/canada,ns,1.52432e+07,4.31485e+06,3.533 -ParseStringOrdered/citm_catalog,ns,1.07738e+07,1.61487e+06,6.672 -ParseStringOrdered/jeopardy,ns,3.58314e+08,1.09968e+08,3.258 -ParseStringOrdered/twitter,ns,4.34017e+06,897816,4.834 -Patch/canada,ns,9.89382e+06,3.30963e+06,2.989 -Patch/citm_catalog,ns,2.49909e+06,1.59354e+06,1.568 -Patch/twitter,ns,1.4469e+06,840978,1.720 -SaxParse/canada,ns,1.27947e+07,3.20901e+06,3.987 -SaxParse/citm_catalog,ns,6.33091e+06,947578,6.681 -SaxParse/twitter,ns,2.47342e+06,467446,5.291 -ToCbor/canada,ns,1.36222e+06,546687,2.492 -ToCbor/citm_catalog,ns,1.0175e+06,254725,3.995 -ToCbor/floats,ns,8.88418e+06,1.88474e+06,4.714 -ToCbor/jeopardy,ns,7.101e+07,2.10445e+07,3.374 -ToCbor/signed_ints,ns,1.1155e+07,2.74959e+06,4.057 -ToCbor/small_signed_ints,ns,1.01055e+07,2.36336e+06,4.276 -ToCbor/twitter,ns,632231,141279,4.475 -ToCbor/unsigned_ints,ns,7.99726e+06,2.748e+06,2.910 -ToJsonStrings/copy,ns,5.81667e+06,5.47945e+06,1.062 -ToJsonStrings/move,ns,5.79569e+06,3.00408e+06,1.929 -Unflatten/canada,ns,4.09596e+07,1.06606e+07,3.842 -Unflatten/citm_catalog,ns,9.66875e+06,3.44544e+06,2.806 -Unflatten/twitter,ns,4.57166e+06,2.08857e+06,2.189 +Accept/canada,ns,1.25437e+07,2.28713e+06,5.484 +Accept/citm_catalog,ns,6.28134e+06,902496,6.960 +Accept/floats,ns,1.11964e+08,2.19716e+07,5.096 +Accept/jeopardy,ns,2.13142e+08,5.70288e+07,3.737 +Accept/signed_ints,ns,1.13451e+08,2.73564e+07,4.147 +Accept/small_signed_ints,ns,5.52119e+07,1.74636e+07,3.162 +Accept/twitter,ns,2.43682e+06,469197,5.194 +Accept/unsigned_ints,ns,1.11739e+08,2.86842e+07,3.895 +BinaryToCbor/1024,ns,290.559,104.43,2.782 +BinaryToCbor/128,ns,244.736,114.39,2.139 +BinaryToCbor/16,ns,241.729,48.5869,4.975 +BinaryToCbor/16384,ns,957.488,416.935,2.296 +BinaryToCbor/2048,ns,314.999,123.874,2.543 +BinaryToCbor/256,ns,263.753,89.8568,2.935 +BinaryToCbor/32,ns,247.99,49.3588,5.024 +BinaryToCbor/32768,ns,1544.84,793.525,1.947 +BinaryToCbor/4096,ns,398.772,169.158,2.357 +BinaryToCbor/512,ns,290.128,100.637,2.883 +BinaryToCbor/64,ns,246.96,81.9565,3.013 +BinaryToCbor/8,ns,244.014,48.5667,5.024 +BinaryToCbor/8192,ns,507.276,249.019,2.037 +Copy/canada,ns,3.60259e+06,2.83774e+06,1.270 +Copy/citm_catalog,ns,1.59513e+06,1.43645e+06,1.110 +Copy/twitter,ns,791709,718409,1.102 +CopyAssign/canada,ns,3.634e+06,2.87724e+06,1.263 +CopyAssign/citm_catalog,ns,1.63849e+06,1.48508e+06,1.103 +CopyAssign/twitter,ns,798844,735446,1.086 +CopyOnly/canada,ns,1.51311e+06,1.49476e+06,1.012 +CopyOnly/citm_catalog,ns,732862,782280,0.937 +CopyOnly/twitter,ns,395055,399033,0.990 +CopyRing/canada,ns,3.63908e+06,2.87582e+06,1.265 +CopyRing/citm_catalog,ns,1.65988e+06,1.51282e+06,1.097 +CopyRing/twitter,ns,838112,768418,1.091 +DestroyOnly/canada,ns,2.10335e+06,1.35995e+06,1.547 +DestroyOnly/citm_catalog,ns,863782,670455,1.288 +DestroyOnly/twitter,ns,399273,322030,1.240 +Diff/canada,ns,3.74782e+07,3.6723e+06,10.206 +Diff/citm_catalog,ns,6.64514e+06,1.07377e+06,6.189 +Diff/twitter,ns,4.73628e+06,636708,7.439 +Dump/canada / -,ns,6.62677e+06,2.25123e+06,2.944 +Dump/canada / 4,ns,8.7042e+06,2.98066e+06,2.920 +Dump/citm_catalog / -,ns,1.35686e+06,290577,4.670 +Dump/citm_catalog / 4,ns,1.89401e+06,416756,4.545 +Dump/floats / -,ns,6.22834e+07,2.32495e+07,2.679 +Dump/floats / 4,ns,6.9976e+07,2.40924e+07,2.904 +Dump/jeopardy / -,ns,2.01307e+08,2.99214e+07,6.728 +Dump/jeopardy / 4,ns,2.17598e+08,3.38669e+07,6.425 +Dump/signed_ints / -,ns,2.32472e+07,1.05121e+07,2.211 +Dump/signed_ints / 4,ns,3.15119e+07,1.11146e+07,2.835 +Dump/small_signed_ints / -,ns,1.75381e+07,7.82657e+06,2.241 +Dump/small_signed_ints / 4,ns,2.45965e+07,8.63097e+06,2.850 +Dump/twitter / -,ns,1.36561e+06,207090,6.594 +Dump/twitter / 4,ns,1.5516e+06,248517,6.243 +Dump/unsigned_ints / -,ns,2.31468e+07,7.93578e+06,2.917 +Dump/unsigned_ints / 4,ns,3.13424e+07,8.35542e+06,3.751 +Equal/canada,ns,450957,332485,1.356 +Equal/citm_catalog,ns,263408,251937,1.046 +Equal/twitter,ns,139223,127010,1.096 +Flatten/canada,ns,2.80443e+07,1.10177e+07,2.545 +Flatten/citm_catalog,ns,6.33655e+06,2.97021e+06,2.133 +Flatten/twitter,ns,3.44993e+06,2.00619e+06,1.720 +FlattenOrdered/citm_catalog,ns,2.49055e+08,1.37328e+06,181.357 +FlattenOrdered/twitter,ns,4.89423e+07,846377,57.826 +FromBinaryBuffer/bjdata / canada,ns,8.12748e+06,4.08424e+06,1.990 +FromBinaryBuffer/bjdata / twitter,ns,3.07351e+06,948285,3.241 +FromBinaryBuffer/bjdata_optimized / canada,ns,8.56879e+06,2.42618e+06,3.532 +FromBinaryBuffer/bjdata_optimized / twitter,ns,3.07745e+06,948044,3.246 +FromBinaryBuffer/bson / canada,ns,9.31889e+06,4.25253e+06,2.191 +FromBinaryBuffer/bson / citm_catalog,ns,3.79713e+06,1.55174e+06,2.447 +FromBinaryBuffer/bson / twitter,ns,3.04829e+06,910005,3.350 +FromBinaryBuffer/cbor / canada,ns,8.26527e+06,2.05962e+06,4.013 +FromBinaryBuffer/cbor / citm_catalog,ns,3.62891e+06,1.41833e+06,2.559 +FromBinaryBuffer/cbor / floats,ns,2.89846e+07,5.39328e+06,5.374 +FromBinaryBuffer/cbor / jeopardy,ns,3.54945e+08,1.1153e+08,3.183 +FromBinaryBuffer/cbor / signed_ints,ns,3.49713e+07,9.53001e+06,3.670 +FromBinaryBuffer/cbor / twitter,ns,3.0017e+06,942493,3.185 +FromBinaryBuffer/msgpack / canada,ns,8.23088e+06,2.05409e+06,4.007 +FromBinaryBuffer/msgpack / citm_catalog,ns,3.67736e+06,1.396e+06,2.634 +FromBinaryBuffer/msgpack / jeopardy,ns,3.51715e+08,1.07205e+08,3.281 +FromBinaryBuffer/msgpack / twitter,ns,2.98346e+06,920736,3.240 +FromBinaryBuffer/ubjson / canada,ns,8.14127e+06,4.10394e+06,1.984 +FromBinaryBuffer/ubjson / citm_catalog,ns,3.75785e+06,1.71291e+06,2.194 +FromBinaryBuffer/ubjson / jeopardy,ns,3.62566e+08,1.12043e+08,3.236 +FromBinaryBuffer/ubjson / twitter,ns,3.07643e+06,944874,3.256 +FromBinaryBuffer/ubjson_optimized / canada,ns,8.38574e+06,2.37988e+06,3.524 +FromBinaryBuffer/ubjson_optimized / twitter,ns,3.08095e+06,943868,3.264 +FromBinaryFile/bjdata / twitter,ns,1.0295e+07,1.89097e+06,5.444 +FromBinaryFile/bson / twitter,ns,9.94972e+06,1.76486e+06,5.638 +FromBinaryFile/cbor / canada,ns,1.39806e+07,4.39308e+06,3.182 +FromBinaryFile/cbor / twitter,ns,9.6646e+06,1.50859e+06,6.406 +FromBinaryFile/ubjson / canada,ns,1.34115e+07,6.19543e+06,2.165 +FromBinaryFile/ubjson / twitter,ns,1.02157e+07,1.89016e+06,5.405 +FromBinaryShape/containers / bjdata,ns,1.40433e+07,6.96436e+06,2.016 +FromBinaryShape/containers / bson,ns,1.682e+07,7.55534e+06,2.226 +FromBinaryShape/containers / cbor,ns,1.35664e+07,3.8756e+06,3.500 +FromBinaryShape/containers / msgpack,ns,1.34934e+07,3.82406e+06,3.529 +FromBinaryShape/containers / ubjson,ns,1.40435e+07,6.9781e+06,2.013 +FromBinaryShape/containers / ubjson_optimized,ns,1.45774e+07,4.45098e+06,3.275 +FromBinaryShape/nested / bjdata,ns,94600.5,37840.9,2.500 +FromBinaryShape/nested / bson,ns,100509,41429.8,2.426 +FromBinaryShape/nested / cbor,ns,91972.7,37251.6,2.469 +FromBinaryShape/nested / msgpack,ns,90727.9,36363.8,2.495 +FromBinaryShape/nested / ubjson,ns,94469,37882.2,2.494 +FromBinaryShape/scalars / bjdata,ns,2.41514e+07,1.12078e+07,2.155 +FromBinaryShape/scalars / cbor,ns,2.5038e+07,5.53384e+06,4.525 +FromBinaryShape/scalars / msgpack,ns,2.40268e+07,5.47092e+06,4.392 +FromBinaryShape/scalars / ubjson,ns,2.44002e+07,1.14029e+07,2.140 +FromCborChunkedString/10000 chunks,ns,88987.2,81634.2,1.090 +FromMsgpack/canada,ns,1.39649e+07,4.41006e+06,3.167 +FromMsgpack/citm_catalog,ns,8.78567e+06,2.21895e+06,3.959 +FromMsgpack/floats,ns,5.87082e+07,2.73509e+07,2.146 +FromMsgpack/jeopardy,ns,1.11544e+09,1.79233e+08,6.223 +FromMsgpack/signed_ints,ns,6.10619e+07,3.2097e+07,1.902 +FromMsgpack/small_signed_ints,ns,6.19196e+07,3.32392e+07,1.863 +FromMsgpack/twitter,ns,9.66391e+06,1.45284e+06,6.652 +FromMsgpack/unsigned_ints,ns,5.47021e+07,2.71662e+07,2.014 +"GetArray>",ns,2212.9,629.827,3.513 +GetArray>,ns,7971.54,1157.96,6.884 +GetArray>,ns,57262.5,40671.2,1.408 +GetArray>,ns,6546.87,657.105,9.963 +GetMap/citm_catalog,ns,3.35706e+06,2.35562e+06,1.425 +GetVectorDouble/floats,ns,6.57437e+06,644146,10.206 +GetVectorInt/signed_ints,ns,7.90848e+06,3.367e+06,2.349 +Iterate/canada,ns,859110,307802,2.791 +Iterate/citm_catalog,ns,293450,179462,1.635 +Iterate/twitter,ns,85889.4,61478.7,1.397 +JsonPointerAt/citm_catalog,ns,1.80266e+06,1.10791e+06,1.627 +JsonPointerAt/twitter,ns,778445,582386,1.337 +JsonPointerContains/citm_catalog,ns,2.6652e+06,1.24663e+06,2.138 +JsonPointerContains/twitter,ns,1.27254e+06,609697,2.087 +JsonPointerParse/citm_catalog,ns,5.60728e+06,2.16895e+06,2.585 +JsonPointerParse/twitter,ns,2.4042e+06,980041,2.453 +JsonPointerToString/citm_catalog,ns,6.55559e+06,1.86437e+06,3.516 +JsonPointerToString/twitter,ns,2.14645e+06,794812,2.701 +ParseFILE/canada,ns,5.17963e+07,1.38332e+07,3.744 +ParseFILE/citm_catalog,ns,3.40359e+07,7.24926e+06,4.695 +ParseFILE/twitter,ns,1.33126e+07,3.28013e+06,4.059 +ParseFile/canada,ns,1.72398e+07,6.19587e+06,2.782 +ParseFile/citm_catalog,ns,7.5903e+06,2.40464e+06,3.157 +ParseFile/floats,ns,1.26663e+08,4.7193e+07,2.684 +ParseFile/jeopardy,ns,3.19976e+08,1.55503e+08,2.058 +ParseFile/signed_ints,ns,1.23409e+08,4.4882e+07,2.750 +ParseFile/small_signed_ints,ns,6.22208e+07,3.25371e+07,1.912 +ParseFile/twitter,ns,3.28655e+06,1.33555e+06,2.461 +ParseFile/unsigned_ints,ns,1.19152e+08,4.60377e+07,2.588 +ParseIndented/canada / 4,ns,3.30986e+07,5.22169e+06,6.339 +ParseIndented/citm_catalog / 4,ns,7.15038e+06,1.7594e+06,4.064 +ParseIndented/jeopardy / 4,ns,3.29973e+08,1.30023e+08,2.538 +ParseIndented/twitter / 4,ns,3.5335e+06,1.09154e+06,3.237 +ParseStreamValues/ndjson,ns,6.99339e+06,3.69843e+06,1.891 +ParseStreamValues/numbers,ns,1.90457e+06,379668,5.016 +ParseString/canada,ns,1.48477e+07,4.48104e+06,3.313 +ParseString/citm_catalog,ns,7.16124e+06,1.75975e+06,4.069 +ParseString/floats,ns,1.17297e+08,2.86476e+07,4.094 +ParseString/jeopardy,ns,2.97063e+08,1.26706e+08,2.344 +ParseString/signed_ints,ns,1.17796e+08,3.09958e+07,3.800 +ParseString/small_signed_ints,ns,6.02349e+07,2.39599e+07,2.514 +ParseString/twitter,ns,3.14349e+06,1.02653e+06,3.062 +ParseString/unsigned_ints,ns,1.17123e+08,3.2164e+07,3.641 +ParseStringOrdered/canada,ns,1.48701e+07,4.3728e+06,3.401 +ParseStringOrdered/citm_catalog,ns,1.06565e+07,1.63405e+06,6.522 +ParseStringOrdered/jeopardy,ns,3.55998e+08,1.09838e+08,3.241 +ParseStringOrdered/twitter,ns,4.29723e+06,903337,4.757 +Patch/canada,ns,9.90601e+06,3.33316e+06,2.972 +Patch/citm_catalog,ns,2.48566e+06,1.60436e+06,1.549 +Patch/twitter,ns,1.44208e+06,846253,1.704 +SaxParse/canada,ns,1.26629e+07,3.18268e+06,3.979 +SaxParse/citm_catalog,ns,6.2984e+06,948233,6.642 +SaxParse/twitter,ns,2.43897e+06,470550,5.183 +ToCbor/canada,ns,1.36093e+06,545893,2.493 +ToCbor/citm_catalog,ns,1.00658e+06,255966,3.932 +ToCbor/floats,ns,8.79386e+06,1.87553e+06,4.689 +ToCbor/jeopardy,ns,7.08239e+07,2.11723e+07,3.345 +ToCbor/signed_ints,ns,1.1165e+07,2.74484e+06,4.068 +ToCbor/small_signed_ints,ns,1.00698e+07,2.36786e+06,4.253 +ToCbor/twitter,ns,625255,145380,4.301 +ToCbor/unsigned_ints,ns,7.91821e+06,2.74734e+06,2.882 +ToJsonStrings/copy,ns,5.77126e+06,5.52441e+06,1.045 +ToJsonStrings/move,ns,5.76994e+06,3.01734e+06,1.912 +Unflatten/canada,ns,4.05029e+07,1.06882e+07,3.790 +Unflatten/citm_catalog,ns,9.51644e+06,3.4248e+06,2.779 +Unflatten/twitter,ns,4.46756e+06,2.07793e+06,2.150 diff --git a/docs/mkdocs/scripts/figures/data/perf_timeline.csv b/docs/mkdocs/scripts/figures/data/perf_timeline.csv index 130c628e3..49d437757 100644 --- a/docs/mkdocs/scripts/figures/data/perf_timeline.csv +++ b/docs/mkdocs/scripts/figures/data/perf_timeline.csv @@ -315,4 +315,4 @@ index,commit,date,pr,subject,parse_twitter,parse_citm,parse_canada,parse_citm_co 313,21ec9bd801,2026-10-27,5915,json_view: fewer allocations when parsing small documents (#5915),1388.282,2469.118,6066.495,2340.391,1744.901,478.745,214.934,292.970,2309.264,422.842,1323.237,138.541,1454.151,1707.314,178.058,366.514,958.110 314,2bb2feeef4,2026-10-27,5942,"Fix the red CI on develop (json_view pointer tokens, bson, from_json tests, Infer, IWYU) (#5942)",1391.981,2468.266,6068.495,2335.707,1751.527,482.908,214.285,291.291,2300.453,417.876,1328.089,138.010,1454.934,1701.845,178.250,367.182,964.917 315,78a0687147,2026-10-27,5940,Strong exception guarantee for operator[](json_pointer) (#5940),1379.414,2467.492,6109.136,2335.309,1723.090,480.260,216.197,292.075,2313.798,415.444,1314.530,138.314,1449.629,1698.792,177.628,364.844,965.314 -316,candidate,,,develop + open pull requests,1404.881,2459.645,5976.210,2313.583,1739.023,477.276,214.858,289.366,2301.972,415.963,1307.406,137.828,1440.710,1714.002,176.462,364.414,971.829 +316,candidate,,,develop + open pull requests,1378.171,2455.459,6104.495,2322.256,1708.449,478.518,213.396,288.204,2276.700,422.782,1304.925,138.585,1429.984,1718.802,176.236,363.908,983.595 diff --git a/docs/mkdocs/scripts/figures/perf_blog.py b/docs/mkdocs/scripts/figures/perf_blog.py index dad1103bc..c96e2253c 100644 --- a/docs/mkdocs/scripts/figures/perf_blog.py +++ b/docs/mkdocs/scripts/figures/perf_blog.py @@ -201,24 +201,24 @@ def digits(): # ---------- overview: speedup per workload (Google Benchmark rows, 3.12.0 time / 3.13.0 time) ---------- # (group, label, speedup), copied from the table "The short version" OVERVIEW = [ - ("Parsing", "twitter.json", 3.10), - ("Parsing", "citm_catalog.json", 4.19), - ("Parsing", "canada.json", 3.45), - ("Parsing", "canada.json, indented", 6.57), - ("Parsing", "citm, ordered_json", 6.67), - ("Parsing", "twitter, std::ifstream", 2.44), - ("Parsing", "citm, FILE*", 4.72), - ("Parsing", "citm, accept()", 7.63), - ("Writing", "dump() twitter", 6.68), - ("Writing", "dump() canada", 2.92), - ("Writing", "dump(4) citm", 4.59), - ("Writing", "to_cbor() twitter", 4.47), - ("Reading CBOR", "twitter, memory", 3.23), - ("Reading CBOR", "twitter, FILE*", 6.50), - ("Values", "diff() canada", 10.43), - ("Values", "iterate canada", 2.70), + ("Parsing", "twitter.json", 3.06), + ("Parsing", "citm_catalog.json", 4.07), + ("Parsing", "canada.json", 3.31), + ("Parsing", "canada.json, indented", 6.34), + ("Parsing", "citm, ordered_json", 6.52), + ("Parsing", "twitter, std::ifstream", 2.46), + ("Parsing", "citm, FILE*", 4.70), + ("Parsing", "citm, accept()", 6.96), + ("Writing", "dump() twitter", 6.59), + ("Writing", "dump() canada", 2.94), + ("Writing", "dump(4) citm", 4.54), + ("Writing", "to_cbor() twitter", 4.30), + ("Reading CBOR", "twitter, memory", 3.19), + ("Reading CBOR", "twitter, FILE*", 6.41), + ("Values", "diff() canada", 10.21), + ("Values", "iterate canada", 2.79), ("Values", "copy + destroy citm", 1.11), - ("Values", "== citm", 1.07), + ("Values", "== citm", 1.05), ] @@ -396,15 +396,15 @@ def timeline(): # ---------- cliffs: 3.12.0 and 3.13.0 times on a log axis ---------- # (operation, 3.12.0 ms, 3.13.0 ms), copied from the table in "Fix the algorithm first" CLIFFS = [ - ("diff() 64k numbers vs []", 4101, 10.1), - ("diff() 20k objects vs half", 119, 3.83), - ("parse() callback, 32k objects", 1348, 11.5), - ("operator< nested 24 deep", 63.6, 0.002), - ("operator< citm, 10x", 273, 3.80), + ("diff() 64k numbers vs []", 4113, 10.1), + ("diff() 20k objects vs half", 119, 3.90), + ("parse() callback, 32k objects", 1363, 11.5), + ("operator< nested 24 deep", 63.7, 0.002), + ("operator< citm, 10x", 274, 3.83), ("flatten() citm, ordered_json", 253, 1.37), - ("to_bson() 200 deep, 100x", 19.5, 0.357), - ("push_back() 100k, diagnostics", 1525, 5.14), - ("at(i) 10k, diagnostics", 43.9, 0.080), + ("to_bson() 200 deep, 100x", 19.8, 0.352), + ("push_back() 100k, diagnostics", 1541, 5.11), + ("at(i) 10k, diagnostics", 44.0, 0.084), ]