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 4fccb968d..bef3db1cc 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,10 +5,10 @@ + develop b2674a4a2f with the open non-draft pull requests #5990-#5992, #5996-#6006 and #6008 merged (local branch + local/all-prs-1102 at f970185114): suite, timeline endpoint, Appendix D and the scalar runs 11-02 (afternoon). The + comparison with other libraries is from 10-31 (develop 9c349b1d7c with the then open pull requests); json_document + parse, accept, dump and compare run the same instructions (within 0.25 %) with the headers of 11-02. --> Since 2016, the [README](https://github.com/nlohmann/json#readme) of this library has said this about speed: @@ -64,7 +64,7 @@ The rows above are chosen to show the range. All 182 benchmarks of the suite:

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 +The median benchmark got 3.0× as fast. Copying and comparing values gained the least, and the largest gains come from fixing algorithms rather than tuning them (theme 7). Eight themes did most of the work: @@ -687,8 +687,9 @@ 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 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. +got 42 to 47 % faster, and `canada.json` 10 %. Arrays of one element skip the loop: in 1,000 arrays nested in each +other, each entered it only to find another array, which cost 6 to 8 %. Now the loop costs nested arrays nothing +measurable, and 100,000 arrays `[1,2]` up to 1.5 %. ### Smaller ones @@ -1054,7 +1055,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.24 to 1.55 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.39 times. ## 8 Build a different data structure { #theme-8 } @@ -1485,24 +1486,24 @@ The rows of the first chart: | workload | 3.12.0 | 3.13.0 | speedup | | --- | --: | --: | --: | -| `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× | +| `json::parse()` of `twitter.json` | 3.18 ms | 1.05 ms | 3.0× | +| `json::parse()` of `citm_catalog.json` | 7.30 ms | 1.78 ms | 4.1× | +| `json::parse()` of `canada.json` | 15.1 ms | 4.42 ms | 3.4× | +| `json::parse()` of `canada.json`, indented by 4 spaces | 33.9 ms | 5.15 ms | 6.6× | +| `ordered_json::parse()` of `citm_catalog.json` | 10.9 ms | 1.62 ms | 6.7× | +| `json::parse()` of `twitter.json` from an `std::ifstream` | 3.32 ms | 1.36 ms | 2.4× | +| `json::parse()` of `citm_catalog.json` from a `FILE*` | 34.6 ms | 7.35 ms | 4.7× | +| `json::accept()` of `citm_catalog.json` | 6.38 ms | 0.907 ms | 7.0× | +| `dump()` of `twitter.json` | 1.39 ms | 0.209 ms | 6.7× | +| `dump()` of `canada.json` | 6.69 ms | 2.29 ms | 2.9× | +| `dump(4)` of `citm_catalog.json` | 1.92 ms | 0.415 ms | 4.6× | +| `to_cbor()` of `twitter.json` | 0.634 ms | 0.142 ms | 4.5× | +| `from_cbor()` of `twitter.json` from memory | 3.04 ms | 0.954 ms | 3.2× | +| `from_cbor()` of `twitter.json` from a `FILE*` | 9.82 ms | 1.53 ms | 6.4× | +| `diff()` of `canada.json` with every eighth scalar changed | 38.1 ms | 3.69 ms | 10.3× | +| iterating over every value of `canada.json` | 0.868 ms | 0.321 ms | 2.7× | +| copying `citm_catalog.json` and destroying the copy | 1.62 ms | 1.46 ms | 1.11× | +| `==` of `citm_catalog.json` and a copy | 0.265 ms | 0.255 ms | 1.04× |

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).

@@ -1510,188 +1511,188 @@ The rows of the first chart: | benchmark | 3.12.0 | 3.13.0 | speedup | | --- | --: | --: | --: | - | `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× | + | `Accept/canada` | 12.7 ms | 2.32 ms | 5.47× | + | `Accept/citm_catalog` | 6.38 ms | 907 µs | 7.04× | + | `Accept/floats` | 113 ms | 22.3 ms | 5.07× | + | `Accept/jeopardy` | 219 ms | 57.5 ms | 3.81× | + | `Accept/signed_ints` | 115 ms | 27.7 ms | 4.16× | + | `Accept/small_signed_ints` | 55.9 ms | 17.7 ms | 3.16× | + | `Accept/twitter` | 2.46 ms | 475 µs | 5.18× | + | `Accept/unsigned_ints` | 114 ms | 29.1 ms | 3.91× | + | `BinaryToCbor/1024` | 303 ns | 102 ns | 2.98× | + | `BinaryToCbor/128` | 247 ns | 115 ns | 2.14× | + | `BinaryToCbor/16384` | 949 ns | 408 ns | 2.33× | + | `BinaryToCbor/16` | 240 ns | 48.7 ns | 4.92× | + | `BinaryToCbor/2048` | 320 ns | 119 ns | 2.68× | + | `BinaryToCbor/256` | 265 ns | 88.1 ns | 3.01× | + | `BinaryToCbor/32768` | 1.53 µs | 801 ns | 1.91× | + | `BinaryToCbor/32` | 249 ns | 48.5 ns | 5.14× | + | `BinaryToCbor/4096` | 412 ns | 169 ns | 2.43× | + | `BinaryToCbor/512` | 289 ns | 97.3 ns | 2.97× | + | `BinaryToCbor/64` | 249 ns | 83.9 ns | 2.97× | + | `BinaryToCbor/8192` | 511 ns | 248 ns | 2.07× | + | `BinaryToCbor/8` | 243 ns | 48.5 ns | 5.01× | + | `Copy/canada` | 3.65 ms | 2.87 ms | 1.27× | + | `Copy/citm_catalog` | 1.62 ms | 1.46 ms | 1.11× | + | `Copy/twitter` | 799 µs | 726 µs | 1.10× | + | `CopyAssign/canada` | 3.67 ms | 2.88 ms | 1.27× | + | `CopyAssign/citm_catalog` | 1.65 ms | 1.49 ms | 1.11× | + | `CopyAssign/twitter` | 808 µs | 739 µs | 1.09× | + | `CopyOnly/canada` | 1.52 ms | 1.5 ms | 1.01× | + | `CopyOnly/citm_catalog` | 743 µs | 782 µs | 0.95× | + | `CopyOnly/twitter` | 400 µs | 403 µs | 0.99× | + | `CopyRing/canada` | 3.68 ms | 2.89 ms | 1.28× | + | `CopyRing/citm_catalog` | 1.69 ms | 1.51 ms | 1.12× | + | `CopyRing/twitter` | 850 µs | 770 µs | 1.10× | + | `DestroyOnly/canada` | 2.13 ms | 1.37 ms | 1.55× | + | `DestroyOnly/citm_catalog` | 876 µs | 674 µs | 1.30× | + | `DestroyOnly/twitter` | 401 µs | 323 µs | 1.24× | + | `Diff/canada` | 38.1 ms | 3.69 ms | 10.3× | + | `Diff/citm_catalog` | 6.78 ms | 1.07 ms | 6.34× | + | `Diff/twitter` | 4.83 ms | 639 µs | 7.55× | + | `Dump/canada / -` | 6.69 ms | 2.29 ms | 2.93× | + | `Dump/canada / 4` | 8.91 ms | 3.01 ms | 2.96× | + | `Dump/citm_catalog / -` | 1.39 ms | 291 µs | 4.78× | + | `Dump/citm_catalog / 4` | 1.92 ms | 415 µs | 4.63× | + | `Dump/floats / -` | 63.2 ms | 23.6 ms | 2.68× | + | `Dump/floats / 4` | 71.1 ms | 24.4 ms | 2.91× | + | `Dump/jeopardy / -` | 203 ms | 30.7 ms | 6.62× | + | `Dump/jeopardy / 4` | 219 ms | 34.6 ms | 6.32× | + | `Dump/signed_ints / -` | 23.7 ms | 10.6 ms | 2.24× | + | `Dump/signed_ints / 4` | 32 ms | 11.2 ms | 2.85× | + | `Dump/small_signed_ints / -` | 17.8 ms | 7.92 ms | 2.25× | + | `Dump/small_signed_ints / 4` | 25 ms | 8.76 ms | 2.85× | + | `Dump/twitter / -` | 1.39 ms | 209 µs | 6.66× | + | `Dump/twitter / 4` | 1.58 ms | 246 µs | 6.43× | + | `Dump/unsigned_ints / -` | 23.6 ms | 8 ms | 2.95× | + | `Dump/unsigned_ints / 4` | 31.9 ms | 8.42 ms | 3.79× | + | `Equal/canada` | 454 µs | 336 µs | 1.35× | + | `Equal/citm_catalog` | 265 µs | 255 µs | 1.04× | + | `Equal/twitter` | 140 µs | 128 µs | 1.10× | + | `Flatten/canada` | 28.4 ms | 11.1 ms | 2.57× | + | `Flatten/citm_catalog` | 6.37 ms | 3 ms | 2.12× | + | `Flatten/twitter` | 3.48 ms | 2.04 ms | 1.70× | + | `FlattenOrdered/citm_catalog` | 251 ms | 1.39 ms | 181× | + | `FlattenOrdered/twitter` | 48.9 ms | 860 µs | 56.9× | + | `FromBinaryBuffer/bjdata / canada` | 8.22 ms | 4.07 ms | 2.02× | + | `FromBinaryBuffer/bjdata / twitter` | 3.11 ms | 958 µs | 3.25× | + | `FromBinaryBuffer/bjdata_optimized / canada` | 8.68 ms | 2.4 ms | 3.62× | + | `FromBinaryBuffer/bjdata_optimized / twitter` | 3.12 ms | 952 µs | 3.28× | + | `FromBinaryBuffer/bson / canada` | 9.43 ms | 4.2 ms | 2.24× | + | `FromBinaryBuffer/bson / citm_catalog` | 3.86 ms | 1.56 ms | 2.47× | + | `FromBinaryBuffer/bson / twitter` | 3.07 ms | 924 µs | 3.32× | + | `FromBinaryBuffer/cbor / canada` | 8.34 ms | 2.06 ms | 4.05× | + | `FromBinaryBuffer/cbor / citm_catalog` | 3.68 ms | 1.44 ms | 2.56× | + | `FromBinaryBuffer/cbor / floats` | 29 ms | 5.43 ms | 5.33× | + | `FromBinaryBuffer/cbor / jeopardy` | 357 ms | 113 ms | 3.17× | + | `FromBinaryBuffer/cbor / signed_ints` | 35.6 ms | 9.69 ms | 3.68× | + | `FromBinaryBuffer/cbor / twitter` | 3.04 ms | 954 µs | 3.18× | + | `FromBinaryBuffer/msgpack / canada` | 8.33 ms | 2.06 ms | 4.03× | + | `FromBinaryBuffer/msgpack / citm_catalog` | 3.68 ms | 1.41 ms | 2.61× | + | `FromBinaryBuffer/msgpack / jeopardy` | 355 ms | 109 ms | 3.25× | + | `FromBinaryBuffer/msgpack / twitter` | 3.03 ms | 935 µs | 3.24× | + | `FromBinaryBuffer/ubjson / canada` | 8.24 ms | 4.08 ms | 2.02× | + | `FromBinaryBuffer/ubjson / citm_catalog` | 3.81 ms | 1.72 ms | 2.21× | + | `FromBinaryBuffer/ubjson / jeopardy` | 364 ms | 113 ms | 3.21× | + | `FromBinaryBuffer/ubjson / twitter` | 3.11 ms | 957 µs | 3.25× | + | `FromBinaryBuffer/ubjson_optimized / canada` | 8.48 ms | 2.37 ms | 3.58× | + | `FromBinaryBuffer/ubjson_optimized / twitter` | 3.11 ms | 952 µs | 3.26× | + | `FromBinaryFile/bjdata / twitter` | 10.4 ms | 1.9 ms | 5.46× | + | `FromBinaryFile/bson / twitter` | 10.1 ms | 1.8 ms | 5.62× | + | `FromBinaryFile/cbor / canada` | 14.2 ms | 4.41 ms | 3.21× | + | `FromBinaryFile/cbor / twitter` | 9.82 ms | 1.53 ms | 6.41× | + | `FromBinaryFile/ubjson / canada` | 13.7 ms | 6.31 ms | 2.16× | + | `FromBinaryFile/ubjson / twitter` | 10.4 ms | 1.9 ms | 5.45× | + | `FromBinaryShape/containers / bjdata` | 14.2 ms | 7.17 ms | 1.98× | + | `FromBinaryShape/containers / bson` | 17 ms | 7.73 ms | 2.20× | + | `FromBinaryShape/containers / cbor` | 13.7 ms | 3.89 ms | 3.53× | + | `FromBinaryShape/containers / msgpack` | 13.7 ms | 3.84 ms | 3.56× | + | `FromBinaryShape/containers / ubjson_optimized` | 14.8 ms | 4.42 ms | 3.33× | + | `FromBinaryShape/containers / ubjson` | 14.2 ms | 7.17 ms | 1.98× | + | `FromBinaryShape/nested / bjdata` | 93.4 µs | 38 µs | 2.46× | + | `FromBinaryShape/nested / bson` | 99.8 µs | 42 µs | 2.38× | + | `FromBinaryShape/nested / cbor` | 92.9 µs | 35.1 µs | 2.64× | + | `FromBinaryShape/nested / msgpack` | 90.7 µs | 34.6 µs | 2.62× | + | `FromBinaryShape/nested / ubjson` | 93.9 µs | 38.1 µs | 2.47× | + | `FromBinaryShape/scalars / bjdata` | 24.4 ms | 11.4 ms | 2.15× | + | `FromBinaryShape/scalars / cbor` | 25.4 ms | 5.63 ms | 4.52× | + | `FromBinaryShape/scalars / msgpack` | 24.3 ms | 5.53 ms | 4.40× | + | `FromBinaryShape/scalars / ubjson` | 24.7 ms | 11.4 ms | 2.16× | + | `FromCborChunkedString/10000 chunks` | 89.8 µs | 81.4 µs | 1.10× | + | `FromMsgpack/canada` | 14.1 ms | 4.42 ms | 3.20× | + | `FromMsgpack/citm_catalog` | 8.88 ms | 2.25 ms | 3.94× | + | `FromMsgpack/floats` | 59.3 ms | 27.7 ms | 2.14× | + | `FromMsgpack/jeopardy` | 1,130 ms | 182 ms | 6.21× | + | `FromMsgpack/signed_ints` | 62.2 ms | 32.8 ms | 1.90× | + | `FromMsgpack/small_signed_ints` | 62.6 ms | 33.7 ms | 1.86× | + | `FromMsgpack/twitter` | 9.78 ms | 1.47 ms | 6.64× | + | `FromMsgpack/unsigned_ints` | 55.5 ms | 27.7 ms | 2.01× | + | `GetArray>` | 2.23 µs | 640 ns | 3.49× | + | `GetArray>` | 8.13 µs | 1.16 µs | 7.00× | + | `GetArray>` | 58.4 µs | 41.8 µs | 1.40× | + | `GetArray>` | 6.66 µs | 666 ns | 9.99× | + | `GetMap/citm_catalog` | 3.41 ms | 2.4 ms | 1.42× | + | `GetVectorDouble/floats` | 6.68 ms | 642 µs | 10.4× | + | `GetVectorInt/signed_ints` | 8.04 ms | 3.35 ms | 2.40× | + | `Iterate/canada` | 868 µs | 321 µs | 2.71× | + | `Iterate/citm_catalog` | 298 µs | 168 µs | 1.78× | + | `Iterate/twitter` | 87 µs | 62.1 µs | 1.40× | + | `JsonPointerAt/citm_catalog` | 1.83 ms | 1.14 ms | 1.60× | + | `JsonPointerAt/twitter` | 788 µs | 594 µs | 1.33× | + | `JsonPointerContains/citm_catalog` | 2.71 ms | 1.23 ms | 2.20× | + | `JsonPointerContains/twitter` | 1.29 ms | 609 µs | 2.13× | + | `JsonPointerParse/citm_catalog` | 5.67 ms | 2.17 ms | 2.61× | + | `JsonPointerParse/twitter` | 2.41 ms | 1 ms | 2.41× | + | `JsonPointerToString/citm_catalog` | 6.62 ms | 1.88 ms | 3.53× | + | `JsonPointerToString/twitter` | 2.18 ms | 806 µs | 2.70× | + | `ParseFILE/canada` | 52.3 ms | 13.9 ms | 3.77× | + | `ParseFILE/citm_catalog` | 34.6 ms | 7.35 ms | 4.71× | + | `ParseFILE/twitter` | 13.6 ms | 3.31 ms | 4.11× | + | `ParseFile/canada` | 17.4 ms | 6.14 ms | 2.84× | + | `ParseFile/citm_catalog` | 7.67 ms | 2.42 ms | 3.16× | + | `ParseFile/floats` | 127 ms | 47.2 ms | 2.70× | + | `ParseFile/jeopardy` | 328 ms | 155 ms | 2.12× | + | `ParseFile/signed_ints` | 125 ms | 45.4 ms | 2.75× | + | `ParseFile/small_signed_ints` | 63 ms | 32.6 ms | 1.93× | + | `ParseFile/twitter` | 3.32 ms | 1.36 ms | 2.44× | + | `ParseFile/unsigned_ints` | 121 ms | 46.6 ms | 2.59× | + | `ParseIndented/canada / 4` | 33.9 ms | 5.15 ms | 6.59× | + | `ParseIndented/citm_catalog / 4` | 7.23 ms | 1.78 ms | 4.05× | + | `ParseIndented/jeopardy / 4` | 335 ms | 131 ms | 2.55× | + | `ParseIndented/twitter / 4` | 3.59 ms | 1.12 ms | 3.20× | + | `ParseStreamValues/ndjson` | 7.01 ms | 3.71 ms | 1.89× | + | `ParseStreamValues/numbers` | 1.89 ms | 381 µs | 4.98× | + | `ParseString/canada` | 15.1 ms | 4.42 ms | 3.41× | + | `ParseString/citm_catalog` | 7.3 ms | 1.78 ms | 4.11× | + | `ParseString/floats` | 119 ms | 27.6 ms | 4.30× | + | `ParseString/jeopardy` | 303 ms | 128 ms | 2.36× | + | `ParseString/signed_ints` | 120 ms | 31.2 ms | 3.84× | + | `ParseString/small_signed_ints` | 60.6 ms | 24.1 ms | 2.52× | + | `ParseString/twitter` | 3.18 ms | 1.05 ms | 3.02× | + | `ParseString/unsigned_ints` | 119 ms | 32.2 ms | 3.69× | + | `ParseStringOrdered/canada` | 15.1 ms | 4.37 ms | 3.45× | + | `ParseStringOrdered/citm_catalog` | 10.9 ms | 1.62 ms | 6.71× | + | `ParseStringOrdered/jeopardy` | 361 ms | 110 ms | 3.29× | + | `ParseStringOrdered/twitter` | 4.36 ms | 906 µs | 4.81× | + | `Patch/canada` | 9.98 ms | 3.37 ms | 2.96× | + | `Patch/citm_catalog` | 2.53 ms | 1.61 ms | 1.57× | + | `Patch/twitter` | 1.46 ms | 851 µs | 1.71× | + | `SaxParse/canada` | 12.8 ms | 3.22 ms | 3.97× | + | `SaxParse/citm_catalog` | 6.41 ms | 983 µs | 6.52× | + | `SaxParse/twitter` | 2.48 ms | 478 µs | 5.19× | + | `ToCbor/canada` | 1.37 ms | 545 µs | 2.51× | + | `ToCbor/citm_catalog` | 1.02 ms | 257 µs | 3.99× | + | `ToCbor/floats` | 8.91 ms | 1.89 ms | 4.71× | + | `ToCbor/jeopardy` | 72 ms | 21.3 ms | 3.37× | + | `ToCbor/signed_ints` | 11.3 ms | 2.76 ms | 4.10× | + | `ToCbor/small_signed_ints` | 10.2 ms | 2.4 ms | 4.25× | + | `ToCbor/twitter` | 634 µs | 142 µs | 4.48× | + | `ToCbor/unsigned_ints` | 8 ms | 2.79 ms | 2.87× | + | `ToJsonStrings/copy` | 5.82 ms | 5.54 ms | 1.05× | + | `ToJsonStrings/move` | 5.82 ms | 3.02 ms | 1.92× | + | `Unflatten/canada` | 41.1 ms | 10.8 ms | 3.80× | + | `Unflatten/citm_catalog` | 9.7 ms | 3.46 ms | 2.80× | + | `Unflatten/twitter` | 4.52 ms | 2.11 ms | 2.14× | ### C. The timeline @@ -1766,15 +1767,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,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] | +| `diff()` of an array of 64,000 numbers against an empty array | 4,140 ms | 10.5 ms | 396× | 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.99 ms | 30× | the same | [#5461][5461] | +| `parse()` with a callback that rejects half of 32,000 objects | 1,361 ms | 12.1 ms | 113× | 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) | 64.0 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) | 278 ms | 3.86 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.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] | +| `to_bson()` of a value nested 200 levels deep, 100× | 19.9 ms | 0.349 ms | 57× | 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,532 ms | 5.04 ms | 304× | 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.6 ms | 0.081 ms | 539× | 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,8 +2258,8 @@ removed because 3.12.0 has no BON8. | machine | Apple M1 Max laptop on AC power, macOS 27.0.1 | | 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 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 | +| suite | 3 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; of 3.12.0 and 3.13.0, the round that differed from the other two by 3.7 % and 1.5 % overall was dropped; the median of the remaining 8 | +| noise | the coefficient of variation was 3 % or less for 172 of the 182 rows with 3.12.0 and 174 with 3.13.0; the largest was 7.3 %, not counting one 3.12.0 run of a 1.5 µs benchmark that a disturbance made 1.4× 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.

@@ -2437,7 +2438,7 @@ measure binary size or memory use. positions on error [#5809][5809]; binary readers' copy [#5501][5501]; `ordered_json` growth [#5609][5609]; arrays at their final size [#5882][5882]; moving keys [#5458][5458], [#5855][5855]; separator check [#5592][5592]; CBOR keys [#5328][5328]; - `accept()` without copies [#5978][5978]; runs of scalars in binary arrays [#5975][5975], [#5980][5980], [#5981][5981]. + `accept()` without copies [#5978][5978]; runs of scalars in binary arrays [#5975][5975], [#5980][5980], [#5981][5981], [#6008][6008]. - 5 **Read the assembly:** stack canary [#5854][5854]; exceptions and inlining [#5838][5838], [#5840][5840], [#5839][5839], [#5836][5836]; aliasing [#5633][5633]; forced inlining [#5878][5878]; branch-free selections [#5908][5908]; code size [#5902][5902]. @@ -2622,3 +2623,4 @@ These are the checks behind the themes: [5980]: https://github.com/nlohmann/json/pull/5980 [5981]: https://github.com/nlohmann/json/pull/5981 [5982]: https://github.com/nlohmann/json/pull/5982 +[6008]: https://github.com/nlohmann/json/pull/6008 diff --git a/docs/mkdocs/docs/images/perf_blog_cliffs.svg b/docs/mkdocs/docs/images/perf_blog_cliffs.svg index 01c26fcc7..83634b234 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 []: 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. +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 []: 4140 ms to 10.5 ms; diff() 20k objects vs half: 119 ms to 3.99 ms; parse() callback, 32k objects: 1361 ms to 12.1 ms; operator< nested 24 deep: 64 ms to 0.002 ms; operator< citm, 10x: 278 ms to 3.86 ms; flatten() citm, ordered_json: 253 ms to 1.37 ms; to_bson() 200 deep, 100x: 19.9 ms to 0.349 ms; push_back() 100k, diagnostics: 1532 ms to 5.04 ms; at(i) 10k, diagnostics: 43.6 ms to 0.081 ms. 1 µs @@ -22,48 +22,48 @@ 3.12.0 3.13.0 diff() 64k numbers vs [] - -diff() 64k numbers vs [], 3.12.0: 4113 ms -diff() 64k numbers vs [], 3.13.0: 10.1 ms -407× + +diff() 64k numbers vs [], 3.12.0: 4140 ms +diff() 64k numbers vs [], 3.13.0: 10.5 ms +394× diff() 20k objects vs half - + diff() 20k objects vs half, 3.12.0: 119 ms -diff() 20k objects vs half, 3.13.0: 3.9 ms -31× +diff() 20k objects vs half, 3.13.0: 3.99 ms +30× parse() callback, 32k objects - -parse() callback, 32k objects, 3.12.0: 1363 ms -parse() callback, 32k objects, 3.13.0: 11.5 ms -119× + +parse() callback, 32k objects, 3.12.0: 1361 ms +parse() callback, 32k objects, 3.13.0: 12.1 ms +112× operator< nested 24 deep - -operator< nested 24 deep, 3.12.0: 63.7 ms + +operator< nested 24 deep, 3.12.0: 64 ms operator< nested 24 deep, 3.13.0: 0.002 ms -31850× +32000× operator< citm, 10x - -operator< citm, 10x, 3.12.0: 274 ms -operator< citm, 10x, 3.13.0: 3.83 ms -72× + +operator< citm, 10x, 3.12.0: 278 ms +operator< citm, 10x, 3.13.0: 3.86 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.8 ms -to_bson() 200 deep, 100x, 3.13.0: 0.352 ms -56× + +to_bson() 200 deep, 100x, 3.12.0: 19.9 ms +to_bson() 200 deep, 100x, 3.13.0: 0.349 ms +57× push_back() 100k, diagnostics - -push_back() 100k, diagnostics, 3.12.0: 1541 ms -push_back() 100k, diagnostics, 3.13.0: 5.11 ms -302× + +push_back() 100k, diagnostics, 3.12.0: 1532 ms +push_back() 100k, diagnostics, 3.13.0: 5.04 ms +304× at(i) 10k, diagnostics - -at(i) 10k, diagnostics, 3.12.0: 44 ms -at(i) 10k, diagnostics, 3.13.0: 0.084 ms -524× + +at(i) 10k, diagnostics, 3.12.0: 43.6 ms +at(i) 10k, diagnostics, 3.13.0: 0.081 ms +538× diff --git a/docs/mkdocs/docs/images/perf_blog_distribution.svg b/docs/mkdocs/docs/images/perf_blog_distribution.svg index 0bbc13892..ecb0e4fd7 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: 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. +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: 58; 5 to 10x: 25; 10x or more: 4. Median 3.0x, geometric mean 3.0x. 0 @@ -21,11 +21,11 @@ 2 to 3×: 58 58 2 to 3× -3 to 5×: 57 -57 +3 to 5×: 58 +58 3 to 5× -5 to 10×: 26 -26 +5 to 10×: 25 +25 5 to 10× 10× or more: 4 4 diff --git a/docs/mkdocs/docs/images/perf_blog_overview.svg b/docs/mkdocs/docs/images/perf_blog_overview.svg index 6e74d0b5c..1bcfe93c4 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.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. +Horizontal bars of the speedup, more is better. twitter.json 3.0x; citm_catalog.json 4.1x; canada.json 3.4x; canada.json, indented 6.6x; citm, ordered_json 6.7x; twitter, std::ifstream 2.4x; citm, FILE* 4.7x; citm, accept() 7.0x; 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.4x; diff() canada 10x; iterate canada 2.7x; copy + destroy citm 1.11x; == citm 1.04x. Parsing Writing Reading C​BOR @@ -28,59 +28,59 @@ 11× twitter.json -twitter.json: 3.1× -3.1× +twitter.json: 3.0× +3.0× citm_catalog.json -citm_catalog.json: 4.1× -4.1× +citm_catalog.json: 4.1× +4.1× canada.json -canada.json: 3.3× -3.3× +canada.json: 3.4× +3.4× canada.json, indented -canada.json, indented: 6.3× -6.3× +canada.json, indented: 6.6× +6.6× citm, ordered_json -citm, ordered_json: 6.5× -6.5× +citm, ordered_json: 6.7× +6.7× twitter, std::ifstream -twitter, std::ifstream: 2.5× -2.5× +twitter, std::ifstream: 2.4× +2.4× citm, FILE* -citm, FILE*: 4.7× -4.7× +citm, FILE*: 4.7× +4.7× citm, accept() -citm, accept(): 7.0× -7.0× +citm, accept(): 7.0× +7.0× dump() twitter -dump() twitter: 6.6× -6.6× +dump() twitter: 6.7× +6.7× dump() canada -dump() canada: 2.9× -2.9× +dump() canada: 2.9× +2.9× dump(4) citm -dump(4) citm: 4.5× -4.5× +dump(4) citm: 4.6× +4.6× to_cbor() twitter -to_cbor() twitter: 4.3× -4.3× +to_cbor() twitter: 4.5× +4.5× twitter, memory -twitter, memory: 3.2× -3.2× +twitter, memory: 3.2× +3.2× twitter, FILE* twitter, FILE*: 6.4× 6.4× diff() canada -diff() canada: 10× -10× +diff() canada: 10× +10× iterate canada -iterate canada: 2.8× -2.8× +iterate canada: 2.7× +2.7× copy + destroy citm copy + destroy citm: 1.11× 1.11× == citm -== citm: 1.05× -1.05× +== citm: 1.04× +1.04× 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 45a1c7eec..ea1c9953c 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 766bfa607..8ff911e57 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 41e63537d..72e98818c 100644 --- a/docs/mkdocs/docs/images/perf_blog_timeline_dump_twitter.svg +++ b/docs/mkdocs/docs/images/perf_blog_timeline_dump_twitter.svg @@ -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 9823fe941..424ae1351 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.7x. Labeled steps, by theme: 1, 4, U, U. +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 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 f4e96a3f9..f6fb2d168 100644 --- a/docs/mkdocs/docs/images/perf_blog_timeline_parse_canada.svg +++ b/docs/mkdocs/docs/images/perf_blog_timeline_parse_canada.svg @@ -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 4c1d43cf8..80557bd9c 100644 --- a/docs/mkdocs/docs/images/perf_blog_timeline_parse_citm.svg +++ b/docs/mkdocs/docs/images/perf_blog_timeline_parse_citm.svg @@ -1,6 +1,6 @@ parse() citm_catalog.json: speedup over 3.12.0 by commit -parse() citm_catalog.json: speedup over 3.12.0 at each of 317 commits, ending at 3.3x. Labeled steps, by theme: 4, 1, 4, 4, 2, 4. +parse() citm_catalog.json: speedup over 3.12.0 at each of 317 commits, ending at 3.4x. Labeled steps, by theme: 4, 1, 4, 4, 2, 4. parse() citm_catalog.json 1× @@ -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 3561c832f..46c1e0804 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.3x. Labeled steps, by theme: 1, 1. +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 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 e6b5062e5..08083d620 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 af16119e8..374ec2fcd 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.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 +Accept/canada,ns,1.26911e+07,2.31896e+06,5.473 +Accept/citm_catalog,ns,6.38348e+06,907300,7.036 +Accept/floats,ns,1.13021e+08,2.2302e+07,5.068 +Accept/jeopardy,ns,2.18859e+08,5.74875e+07,3.807 +Accept/signed_ints,ns,1.15082e+08,2.76628e+07,4.160 +Accept/small_signed_ints,ns,5.58745e+07,1.76566e+07,3.165 +Accept/twitter,ns,2.45895e+06,474623,5.181 +Accept/unsigned_ints,ns,1.13737e+08,2.91215e+07,3.906 +BinaryToCbor/1024,ns,303.306,101.854,2.978 +BinaryToCbor/128,ns,247.228,115.274,2.145 +BinaryToCbor/16,ns,239.518,48.6796,4.920 +BinaryToCbor/16384,ns,949.458,408.254,2.326 +BinaryToCbor/2048,ns,320.309,119.299,2.685 +BinaryToCbor/256,ns,265.095,88.0809,3.010 +BinaryToCbor/32,ns,249.054,48.4924,5.136 +BinaryToCbor/32768,ns,1533.16,801.01,1.914 +BinaryToCbor/4096,ns,412.14,169.413,2.433 +BinaryToCbor/512,ns,289.358,97.2851,2.974 +BinaryToCbor/64,ns,249.278,83.8812,2.972 +BinaryToCbor/8,ns,242.904,48.4594,5.013 +BinaryToCbor/8192,ns,511.492,247.585,2.066 +Copy/canada,ns,3.65404e+06,2.86994e+06,1.273 +Copy/citm_catalog,ns,1.62077e+06,1.45859e+06,1.111 +Copy/twitter,ns,799004,725731,1.101 +CopyAssign/canada,ns,3.66694e+06,2.88365e+06,1.272 +CopyAssign/citm_catalog,ns,1.65324e+06,1.49021e+06,1.109 +CopyAssign/twitter,ns,807988,738979,1.093 +CopyOnly/canada,ns,1.51887e+06,1.50295e+06,1.011 +CopyOnly/citm_catalog,ns,743278,781882,0.951 +CopyOnly/twitter,ns,400238,403229,0.993 +CopyRing/canada,ns,3.68209e+06,2.88747e+06,1.275 +CopyRing/citm_catalog,ns,1.68855e+06,1.51116e+06,1.117 +CopyRing/twitter,ns,849612,769730,1.104 +DestroyOnly/canada,ns,2.12854e+06,1.37108e+06,1.552 +DestroyOnly/citm_catalog,ns,875707,674090,1.299 +DestroyOnly/twitter,ns,401328,322604,1.244 +Diff/canada,ns,3.81123e+07,3.68674e+06,10.338 +Diff/citm_catalog,ns,6.77551e+06,1.06847e+06,6.341 +Diff/twitter,ns,4.82656e+06,639150,7.552 +Dump/canada / -,ns,6.6893e+06,2.28575e+06,2.927 +Dump/canada / 4,ns,8.91301e+06,3.0094e+06,2.962 +Dump/citm_catalog / -,ns,1.38998e+06,291064,4.776 +Dump/citm_catalog / 4,ns,1.92209e+06,414843,4.633 +Dump/floats / -,ns,6.31567e+07,2.35913e+07,2.677 +Dump/floats / 4,ns,7.1106e+07,2.44198e+07,2.912 +Dump/jeopardy / -,ns,2.03467e+08,3.07362e+07,6.620 +Dump/jeopardy / 4,ns,2.18712e+08,3.4619e+07,6.318 +Dump/signed_ints / -,ns,2.37468e+07,1.06034e+07,2.240 +Dump/signed_ints / 4,ns,3.1988e+07,1.12253e+07,2.850 +Dump/small_signed_ints / -,ns,1.7782e+07,7.91902e+06,2.245 +Dump/small_signed_ints / 4,ns,2.4964e+07,8.76268e+06,2.849 +Dump/twitter / -,ns,1.39069e+06,208747,6.662 +Dump/twitter / 4,ns,1.58219e+06,246027,6.431 +Dump/unsigned_ints / -,ns,2.36168e+07,7.99718e+06,2.953 +Dump/unsigned_ints / 4,ns,3.19304e+07,8.41574e+06,3.794 +Equal/canada,ns,454099,336428,1.350 +Equal/citm_catalog,ns,265088,254849,1.040 +Equal/twitter,ns,140412,127744,1.099 +Flatten/canada,ns,2.8443e+07,1.1054e+07,2.573 +Flatten/citm_catalog,ns,6.37309e+06,3.00071e+06,2.124 +Flatten/twitter,ns,3.47895e+06,2.04063e+06,1.705 +FlattenOrdered/citm_catalog,ns,2.51402e+08,1.38824e+06,181.094 +FlattenOrdered/twitter,ns,4.89453e+07,860119,56.905 +FromBinaryBuffer/bjdata / canada,ns,8.21979e+06,4.07412e+06,2.018 +FromBinaryBuffer/bjdata / twitter,ns,3.11089e+06,957789,3.248 +FromBinaryBuffer/bjdata_optimized / canada,ns,8.68489e+06,2.39853e+06,3.621 +FromBinaryBuffer/bjdata_optimized / twitter,ns,3.11963e+06,952143,3.276 +FromBinaryBuffer/bson / canada,ns,9.42574e+06,4.20336e+06,2.242 +FromBinaryBuffer/bson / citm_catalog,ns,3.86254e+06,1.56165e+06,2.473 +FromBinaryBuffer/bson / twitter,ns,3.0653e+06,923900,3.318 +FromBinaryBuffer/cbor / canada,ns,8.3425e+06,2.06207e+06,4.046 +FromBinaryBuffer/cbor / citm_catalog,ns,3.68456e+06,1.43886e+06,2.561 +FromBinaryBuffer/cbor / floats,ns,2.89541e+07,5.43061e+06,5.332 +FromBinaryBuffer/cbor / jeopardy,ns,3.5724e+08,1.12871e+08,3.165 +FromBinaryBuffer/cbor / signed_ints,ns,3.56166e+07,9.68737e+06,3.677 +FromBinaryBuffer/cbor / twitter,ns,3.03558e+06,953772,3.183 +FromBinaryBuffer/msgpack / canada,ns,8.3272e+06,2.06449e+06,4.034 +FromBinaryBuffer/msgpack / citm_catalog,ns,3.68401e+06,1.41095e+06,2.611 +FromBinaryBuffer/msgpack / jeopardy,ns,3.54505e+08,1.09031e+08,3.251 +FromBinaryBuffer/msgpack / twitter,ns,3.02687e+06,934627,3.239 +FromBinaryBuffer/ubjson / canada,ns,8.23819e+06,4.08039e+06,2.019 +FromBinaryBuffer/ubjson / citm_catalog,ns,3.81107e+06,1.72436e+06,2.210 +FromBinaryBuffer/ubjson / jeopardy,ns,3.64419e+08,1.13389e+08,3.214 +FromBinaryBuffer/ubjson / twitter,ns,3.1103e+06,957344,3.249 +FromBinaryBuffer/ubjson_optimized / canada,ns,8.48001e+06,2.36934e+06,3.579 +FromBinaryBuffer/ubjson_optimized / twitter,ns,3.10764e+06,952334,3.263 +FromBinaryFile/bjdata / twitter,ns,1.03821e+07,1.90031e+06,5.463 +FromBinaryFile/bson / twitter,ns,1.01272e+07,1.80218e+06,5.619 +FromBinaryFile/cbor / canada,ns,1.41591e+07,4.41088e+06,3.210 +FromBinaryFile/cbor / twitter,ns,9.81686e+06,1.53188e+06,6.408 +FromBinaryFile/ubjson / canada,ns,1.36558e+07,6.313e+06,2.163 +FromBinaryFile/ubjson / twitter,ns,1.03653e+07,1.90283e+06,5.447 +FromBinaryShape/containers / bjdata,ns,1.41661e+07,7.16958e+06,1.976 +FromBinaryShape/containers / bson,ns,1.69957e+07,7.73162e+06,2.198 +FromBinaryShape/containers / cbor,ns,1.37448e+07,3.88944e+06,3.534 +FromBinaryShape/containers / msgpack,ns,1.36707e+07,3.84073e+06,3.559 +FromBinaryShape/containers / ubjson,ns,1.41846e+07,7.17314e+06,1.977 +FromBinaryShape/containers / ubjson_optimized,ns,1.47508e+07,4.4236e+06,3.335 +FromBinaryShape/nested / bjdata,ns,93440.7,37989.3,2.460 +FromBinaryShape/nested / bson,ns,99835.8,42028.7,2.375 +FromBinaryShape/nested / cbor,ns,92913.6,35141.4,2.644 +FromBinaryShape/nested / msgpack,ns,90678.9,34607.5,2.620 +FromBinaryShape/nested / ubjson,ns,93863.6,38056.3,2.466 +FromBinaryShape/scalars / bjdata,ns,2.44312e+07,1.13593e+07,2.151 +FromBinaryShape/scalars / cbor,ns,2.54479e+07,5.6307e+06,4.519 +FromBinaryShape/scalars / msgpack,ns,2.42975e+07,5.5278e+06,4.396 +FromBinaryShape/scalars / ubjson,ns,2.46773e+07,1.14308e+07,2.159 +FromCborChunkedString/10000 chunks,ns,89835.8,81350.8,1.104 +FromMsgpack/canada,ns,1.41497e+07,4.42303e+06,3.199 +FromMsgpack/citm_catalog,ns,8.88096e+06,2.25194e+06,3.944 +FromMsgpack/floats,ns,5.92552e+07,2.76614e+07,2.142 +FromMsgpack/jeopardy,ns,1.13309e+09,1.82341e+08,6.214 +FromMsgpack/signed_ints,ns,6.22313e+07,3.28285e+07,1.896 +FromMsgpack/small_signed_ints,ns,6.26259e+07,3.37353e+07,1.856 +FromMsgpack/twitter,ns,9.78102e+06,1.47267e+06,6.642 +FromMsgpack/unsigned_ints,ns,5.55099e+07,2.76571e+07,2.007 +"GetArray>",ns,2231.77,639.734,3.489 +GetArray>,ns,8132.06,1161.87,6.999 +GetArray>,ns,58400.5,41782.2,1.398 +GetArray>,ns,6658.53,666.403,9.992 +GetMap/citm_catalog,ns,3.41376e+06,2.3993e+06,1.423 +GetVectorDouble/floats,ns,6.68224e+06,642457,10.401 +GetVectorInt/signed_ints,ns,8.0387e+06,3.34843e+06,2.401 +Iterate/canada,ns,868241,320718,2.707 +Iterate/citm_catalog,ns,298022,167702,1.777 +Iterate/twitter,ns,87014.5,62127.2,1.401 +JsonPointerAt/citm_catalog,ns,1.82891e+06,1.14298e+06,1.600 +JsonPointerAt/twitter,ns,787985,594251,1.326 +JsonPointerContains/citm_catalog,ns,2.71277e+06,1.23364e+06,2.199 +JsonPointerContains/twitter,ns,1.29352e+06,608656,2.125 +JsonPointerParse/citm_catalog,ns,5.67308e+06,2.17151e+06,2.613 +JsonPointerParse/twitter,ns,2.41421e+06,1.00071e+06,2.413 +JsonPointerToString/citm_catalog,ns,6.62468e+06,1.87578e+06,3.532 +JsonPointerToString/twitter,ns,2.1792e+06,806356,2.703 +ParseFILE/canada,ns,5.23333e+07,1.38865e+07,3.769 +ParseFILE/citm_catalog,ns,3.4642e+07,7.34915e+06,4.714 +ParseFILE/twitter,ns,1.35777e+07,3.3065e+06,4.106 +ParseFile/canada,ns,1.74258e+07,6.136e+06,2.840 +ParseFile/citm_catalog,ns,7.66744e+06,2.424e+06,3.163 +ParseFile/floats,ns,1.275e+08,4.72331e+07,2.699 +ParseFile/jeopardy,ns,3.27525e+08,1.54786e+08,2.116 +ParseFile/signed_ints,ns,1.2488e+08,4.54429e+07,2.748 +ParseFile/small_signed_ints,ns,6.29991e+07,3.26251e+07,1.931 +ParseFile/twitter,ns,3.32202e+06,1.35873e+06,2.445 +ParseFile/unsigned_ints,ns,1.20673e+08,4.65984e+07,2.590 +ParseIndented/canada / 4,ns,3.39369e+07,5.15262e+06,6.586 +ParseIndented/citm_catalog / 4,ns,7.23096e+06,1.78365e+06,4.054 +ParseIndented/jeopardy / 4,ns,3.35238e+08,1.31409e+08,2.551 +ParseIndented/twitter / 4,ns,3.59342e+06,1.1224e+06,3.202 +ParseStreamValues/ndjson,ns,7.01242e+06,3.71441e+06,1.888 +ParseStreamValues/numbers,ns,1.89341e+06,380502,4.976 +ParseString/canada,ns,1.50855e+07,4.42155e+06,3.412 +ParseString/citm_catalog,ns,7.3013e+06,1.77547e+06,4.112 +ParseString/floats,ns,1.18738e+08,2.7604e+07,4.301 +ParseString/jeopardy,ns,3.03339e+08,1.28463e+08,2.361 +ParseString/signed_ints,ns,1.20073e+08,3.12419e+07,3.843 +ParseString/small_signed_ints,ns,6.0595e+07,2.40917e+07,2.515 +ParseString/twitter,ns,3.17558e+06,1.05133e+06,3.021 +ParseString/unsigned_ints,ns,1.18614e+08,3.21863e+07,3.685 +ParseStringOrdered/canada,ns,1.50775e+07,4.37102e+06,3.449 +ParseStringOrdered/citm_catalog,ns,1.08507e+07,1.61676e+06,6.711 +ParseStringOrdered/jeopardy,ns,3.60997e+08,1.09757e+08,3.289 +ParseStringOrdered/twitter,ns,4.35833e+06,906250,4.809 +Patch/canada,ns,9.97854e+06,3.36623e+06,2.964 +Patch/citm_catalog,ns,2.52632e+06,1.61385e+06,1.565 +Patch/twitter,ns,1.45777e+06,850736,1.714 +SaxParse/canada,ns,1.27867e+07,3.22211e+06,3.968 +SaxParse/citm_catalog,ns,6.40874e+06,983039,6.519 +SaxParse/twitter,ns,2.47756e+06,477699,5.186 +ToCbor/canada,ns,1.37097e+06,545183,2.515 +ToCbor/citm_catalog,ns,1.02285e+06,256578,3.986 +ToCbor/floats,ns,8.91388e+06,1.89274e+06,4.710 +ToCbor/jeopardy,ns,7.19583e+07,2.13225e+07,3.375 +ToCbor/signed_ints,ns,1.13095e+07,2.75682e+06,4.102 +ToCbor/small_signed_ints,ns,1.0181e+07,2.39796e+06,4.246 +ToCbor/twitter,ns,633945,141532,4.479 +ToCbor/unsigned_ints,ns,7.99728e+06,2.79118e+06,2.865 +ToJsonStrings/copy,ns,5.82015e+06,5.54332e+06,1.050 +ToJsonStrings/move,ns,5.81645e+06,3.0241e+06,1.923 +Unflatten/canada,ns,4.1091e+07,1.08224e+07,3.797 +Unflatten/citm_catalog,ns,9.69933e+06,3.46205e+06,2.802 +Unflatten/twitter,ns,4.51774e+06,2.10929e+06,2.142 diff --git a/docs/mkdocs/scripts/figures/data/perf_timeline.csv b/docs/mkdocs/scripts/figures/data/perf_timeline.csv index 49d437757..9d08e6668 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,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 +316,candidate,,,develop + open pull requests,1372.590,2427.358,6109.560,2302.737,1710.146,479.478,211.001,288.697,2298.316,416.541,1311.621,139.627,1439.814,1711.536,177.113,365.393,979.186 diff --git a/docs/mkdocs/scripts/figures/perf_blog.py b/docs/mkdocs/scripts/figures/perf_blog.py index c96e2253c..fe9022831 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.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), + ("Parsing", "twitter.json", 3.02), + ("Parsing", "citm_catalog.json", 4.11), + ("Parsing", "canada.json", 3.41), + ("Parsing", "canada.json, indented", 6.59), + ("Parsing", "citm, ordered_json", 6.71), + ("Parsing", "twitter, std::ifstream", 2.44), + ("Parsing", "citm, FILE*", 4.71), + ("Parsing", "citm, accept()", 7.04), + ("Writing", "dump() twitter", 6.66), + ("Writing", "dump() canada", 2.93), + ("Writing", "dump(4) citm", 4.63), + ("Writing", "to_cbor() twitter", 4.48), + ("Reading CBOR", "twitter, memory", 3.18), ("Reading CBOR", "twitter, FILE*", 6.41), - ("Values", "diff() canada", 10.21), - ("Values", "iterate canada", 2.79), + ("Values", "diff() canada", 10.34), + ("Values", "iterate canada", 2.71), ("Values", "copy + destroy citm", 1.11), - ("Values", "== citm", 1.05), + ("Values", "== citm", 1.04), ] @@ -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 []", 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), + ("diff() 64k numbers vs []", 4140, 10.5), + ("diff() 20k objects vs half", 119, 3.99), + ("parse() callback, 32k objects", 1361, 12.1), + ("operator< nested 24 deep", 64.0, 0.002), + ("operator< citm, 10x", 278, 3.86), ("flatten() citm, ordered_json", 253, 1.37), - ("to_bson() 200 deep, 100x", 19.8, 0.352), - ("push_back() 100k, diagnostics", 1541, 5.11), - ("at(i) 10k, diagnostics", 44.0, 0.084), + ("to_bson() 200 deep, 100x", 19.9, 0.349), + ("push_back() 100k, diagnostics", 1532, 5.04), + ("at(i) 10k, diagnostics", 43.6, 0.081), ]