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.