docs: add the blog post "How 3.13.0 got faster"

A post for the documentation (Home > Blog) on how 3.13.0 became faster:
eight themes with the pull requests behind them, the ideas taken from other
libraries, what did not work, how the fast paths are tested, and the
compile-time cost. Every number comes from a run on 2026-10-27 (3.12.0 against
develop plus the open non-draft PRs, Apple M1 Max) or from the linked PR.

- docs/mkdocs/docs/home/blog/how_3_13_0_got_faster.md: the post.
- docs/mkdocs/scripts/figures/perf_blog.py: draws its 12 figures (overview,
  eight timeline panels, the SWAR test, the cliffs, json_view throughput) as
  inline SVGs in the nj-charts style; data/perf_timeline.csv holds the
  timeline.
- tests/benchmarks/history: history.cpp and history.py time one fixed program
  against the header of every commit that changed it, interleaved, and write
  one CSV row per commit with its PR. The timeline of the post comes from it.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-30 15:29:45 +01:00
1 parent d20c4dcd89
commit ea848cd2e8
21 files changed
+2297

No files matched your search

@@ -0,0 +1,37 @@
<svg class="nj-fig nj-charts nj-charts--timeline" viewBox="0 0 340 252" role="img" aria-labelledby="nj-blog-tl-parse_citm nj-blog-tl-parse_citm-d" xmlns="http://www.w3.org/2000/svg">
<title id="nj-blog-tl-parse_citm">parse() citm_catalog.json: speedup over 3.12.0 by commit</title>
<desc id="nj-blog-tl-parse_citm-d">parse() citm_catalog.json: speedup over 3.12.0 at each of 317 commits, ending at 3.3x. Labeled steps: #5234, #5283, #5592, #5809, #5810, #5882.</desc>
<text class="nj-charts-panel" x="8" y="18">parse() citm_catalog.json</text>
<line class="nj-charts-grid" x1="44" y1="208" x2="330" y2="208"/>
<text class="nj-charts-tick nj-charts-tick--r" x="38" y="212">1&#215;</text>
<line class="nj-charts-grid" x1="44" y1="159.333" x2="330" y2="159.333"/>
<text class="nj-charts-tick nj-charts-tick--r" x="38" y="163.333">2&#215;</text>
<line class="nj-charts-grid" x1="44" y1="110.667" x2="330" y2="110.667"/>
<text class="nj-charts-tick nj-charts-tick--r" x="38" y="114.667">4&#215;</text>
<line class="nj-charts-grid" x1="44" y1="62" x2="330" y2="62"/>
<text class="nj-charts-tick nj-charts-tick--r" x="38" y="66">8&#215;</text>
<line class="nj-charts-axis" x1="44" y1="208" x2="44" y2="212"/>
<text class="nj-charts-tick" x="44" y="225">3.12.0</text>
<line class="nj-charts-axis" x1="126.361" y1="208" x2="126.361" y2="212"/>
<text class="nj-charts-tick" x="126.361" y="225">Sep 2026</text>
<line class="nj-charts-axis" x1="215.962" y1="208" x2="215.962" y2="212"/>
<text class="nj-charts-tick" x="215.962" y="225">Oct</text>
<polyline class="nj-charts-json" points="44.0,208.0 44.9,208.0 44.9,208.2 45.8,208.2 45.8,207.8 46.7,207.8 46.7,207.5 47.6,207.5 47.6,206.4 48.5,206.4 48.5,208.3 49.4,208.3 49.4,207.3 50.3,207.3 50.3,206.8 51.2,206.8 51.2,207.8 52.1,207.8 52.1,206.8 53.1,206.8 53.1,207.3 54.0,207.3 54.0,207.6 54.9,207.6 54.9,207.8 55.8,207.8 55.8,207.0 56.7,207.0 56.7,207.2 57.6,207.2 57.6,207.2 58.5,207.2 58.5,207.3 59.4,207.3 59.4,207.5 60.3,207.5 60.3,207.4 61.2,207.4 61.2,206.5 62.1,206.5 62.1,207.6 63.0,207.6 63.0,207.6 63.9,207.6 63.9,207.1 64.8,207.1 64.8,207.0 65.7,207.0 65.7,207.6 66.6,207.6 66.6,206.6 67.5,206.6 67.5,207.3 68.4,207.3 68.4,206.8 69.3,206.8 69.3,207.3 70.2,207.3 70.2,207.7 71.2,207.7 71.2,207.9 72.1,207.9 72.1,207.2 73.0,207.2 73.0,206.4 73.9,206.4 73.9,207.6 74.8,207.6 74.8,206.4 75.7,206.4 75.7,208.0 76.6,208.0 76.6,207.4 77.5,207.4 77.5,206.4 78.4,206.4 78.4,207.5 79.3,207.5 79.3,207.1 80.2,207.1 80.2,206.9 81.1,206.9 81.1,207.6 82.0,207.6 82.0,207.6 82.9,207.6 82.9,207.0 83.8,207.0 83.8,206.8 84.7,206.8 84.7,208.0 85.6,208.0 85.6,207.6 86.5,207.6 86.5,206.6 87.4,206.6 87.4,206.7 88.3,206.7 88.3,207.3 89.3,207.3 89.3,206.9 90.2,206.9 90.2,207.6 91.1,207.6 91.1,207.1 92.0,207.1 92.0,207.6 92.9,207.6 92.9,207.9 93.8,207.9 93.8,177.3 94.7,177.3 94.7,176.7 95.6,176.7 95.6,176.9 96.5,176.9 96.5,176.8 97.4,176.8 97.4,176.8 98.3,176.8 98.3,176.2 99.2,176.2 99.2,176.0 100.1,176.0 100.1,176.8 101.0,176.8 101.0,176.7 101.9,176.7 101.9,175.9 102.8,175.9 102.8,177.0 103.7,177.0 103.7,176.1 104.6,176.1 104.6,175.9 105.5,175.9 105.5,177.2 106.4,177.2 106.4,177.2 107.4,177.2 107.4,176.7 108.3,176.7 108.3,176.8 109.2,176.8 109.2,176.6 110.1,176.6 110.1,176.8 111.0,176.8 111.0,177.0 111.9,177.0 111.9,176.7 112.8,176.7 112.8,177.1 113.7,177.1 113.7,176.8 114.6,176.8 114.6,175.0 115.5,175.0 115.5,176.6 116.4,176.6 116.4,176.7 117.3,176.7 117.3,176.8 118.2,176.8 118.2,176.0 119.1,176.0 119.1,176.6 120.0,176.6 120.0,176.5 120.9,176.5 120.9,176.5 121.8,176.5 121.8,176.0 122.7,176.0 122.7,177.1 123.6,177.1 123.6,176.4 124.6,176.4 124.6,175.7 125.5,175.7 125.5,176.6 126.4,176.6 126.4,176.6 127.3,176.6 127.3,176.6 128.2,176.6 128.2,176.6 129.1,176.6 129.1,176.2 130.0,176.2 130.0,176.9 130.9,176.9 130.9,175.3 131.8,175.3 131.8,176.1 132.7,176.1 132.7,176.6 133.6,176.6 133.6,176.9 134.5,176.9 134.5,176.9 135.4,176.9 135.4,177.0 136.3,177.0 136.3,176.4 137.2,176.4 137.2,176.6 138.1,176.6 138.1,176.6 139.0,176.6 139.0,176.3 139.9,176.3 139.9,161.2 140.8,161.2 140.8,160.9 141.7,160.9 141.7,160.4 142.7,160.4 142.7,160.9 143.6,160.9 143.6,159.8 144.5,159.8 144.5,159.4 145.4,159.4 145.4,158.0 146.3,158.0 146.3,158.9 147.2,158.9 147.2,159.0 148.1,159.0 148.1,159.3 149.0,159.3 149.0,158.1 149.9,158.1 149.9,159.1 150.8,159.1 150.8,158.2 151.7,158.2 151.7,158.6 152.6,158.6 152.6,158.5 153.5,158.5 153.5,158.8 154.4,158.8 154.4,158.3 155.3,158.3 155.3,159.4 156.2,159.4 156.2,158.8 157.1,158.8 157.1,157.7 158.0,157.7 158.0,158.4 158.9,158.4 158.9,158.5 159.8,158.5 159.8,159.2 160.8,159.2 160.8,158.9 161.7,158.9 161.7,158.6 162.6,158.6 162.6,159.1 163.5,159.1 163.5,159.2 164.4,159.2 164.4,159.2 165.3,159.2 165.3,158.3 166.2,158.3 166.2,158.2 167.1,158.2 167.1,158.7 168.0,158.7 168.0,158.9 168.9,158.9 168.9,158.7 169.8,158.7 169.8,159.2 170.7,159.2 170.7,158.5 171.6,158.5 171.6,158.9 172.5,158.9 172.5,158.7 173.4,158.7 173.4,159.5 174.3,159.5 174.3,157.8 175.2,157.8 175.2,158.3 176.1,158.3 176.1,157.8 177.0,157.8 177.0,158.6 177.9,158.6 177.9,158.0 178.9,158.0 178.9,158.3 179.8,158.3 179.8,158.1 180.7,158.1 180.7,158.7 181.6,158.7 181.6,157.7 182.5,157.7 182.5,158.0 183.4,158.0 183.4,158.9 184.3,158.9 184.3,160.0 185.2,160.0 185.2,160.4 186.1,160.4 186.1,160.3 187.0,160.3 187.0,158.9 187.9,158.9 187.9,159.7 188.8,159.7 188.8,159.9 189.7,159.9 189.7,160.4 190.6,160.4 190.6,159.8 191.5,159.8 191.5,159.1 192.4,159.1 192.4,160.3 193.3,160.3 193.3,159.3 194.2,159.3 194.2,160.1 195.1,160.1 195.1,160.0 196.1,160.0 196.1,160.0 197.0,160.0 197.0,160.4 197.9,160.4 197.9,159.9 198.8,159.9 198.8,158.7 199.7,158.7 199.7,159.6 200.6,159.6 200.6,160.2 201.5,160.2 201.5,159.3 202.4,159.3 202.4,160.6 203.3,160.6 203.3,160.1 204.2,160.1 204.2,158.7 205.1,158.7 205.1,159.2 206.0,159.2 206.0,160.7 206.9,160.7 206.9,160.2 207.8,160.2 207.8,160.7 208.7,160.7 208.7,160.0 209.6,160.0 209.6,161.1 210.5,161.1 210.5,160.8 211.4,160.8 211.4,159.5 212.3,159.5 212.3,160.2 213.2,160.2 213.2,160.1 214.2,160.1 214.2,161.0 215.1,161.0 215.1,160.1 216.0,160.1 216.0,160.1 216.9,160.1 216.9,160.5 217.8,160.5 217.8,159.4 218.7,159.4 218.7,159.2 219.6,159.2 219.6,159.1 220.5,159.1 220.5,157.9 221.4,157.9 221.4,158.1 222.3,158.1 222.3,159.0 223.2,159.0 223.2,158.7 224.1,158.7 224.1,159.0 225.0,159.0 225.0,159.1 225.9,159.1 225.9,159.5 226.8,159.5 226.8,158.5 227.7,158.5 227.7,158.0 228.6,158.0 228.6,159.2 229.5,159.2 229.5,158.8 230.4,158.8 230.4,159.4 231.3,159.4 231.3,159.3 232.3,159.3 232.3,158.1 233.2,158.1 233.2,159.7 234.1,159.7 234.1,160.0 235.0,160.0 235.0,159.7 235.9Line truncated
<circle class="nj-charts-json-dot" cx="93.8" cy="177.3" r="3.5"><title>#5234: 1.55&#215;</title></circle>
<line class="nj-charts-grid" stroke-dasharray="2 2" x1="93.8" y1="54.0" x2="93.8" y2="172.3"/>
<text class="nj-charts-note" x="93.8" y="50.0" text-anchor="middle">#5234</text>
<circle class="nj-charts-json-dot" cx="139.9" cy="161.2" r="3.5"><title>#5283: 1.95&#215;</title></circle>
<line class="nj-charts-grid" stroke-dasharray="2 2" x1="139.9" y1="54.0" x2="139.9" y2="156.2"/>
<text class="nj-charts-note" x="139.9" y="50.0" text-anchor="middle">#5283</text>
<circle class="nj-charts-json-dot" cx="243.1" cy="153.9" r="3.5"><title>#5592: 2.2&#215;</title></circle>
<line class="nj-charts-grid" stroke-dasharray="2 2" x1="243.1" y1="54.0" x2="243.1" y2="148.9"/>
<text class="nj-charts-note" x="243.1" y="50.0" text-anchor="middle">#5592</text>
<circle class="nj-charts-json-dot" cx="265.7" cy="145.4" r="3.5"><title>#5809: 2.4&#215;</title></circle>
<circle class="nj-charts-json-dot" cx="266.6" cy="136.3" r="3.5"><title>#5810: 2.8&#215;</title></circle>
<line class="nj-charts-grid" stroke-dasharray="2 2" x1="266.6" y1="41.0" x2="266.6" y2="131.3"/>
<text class="nj-charts-note" x="266.6" y="37.0" text-anchor="middle">#5809, #5810</text>
<circle class="nj-charts-json-dot" cx="312.8" cy="123.3" r="3.5"><title>#5882: 3.3&#215;</title></circle>
<line class="nj-charts-grid" stroke-dasharray="2 2" x1="312.8" y1="54.0" x2="312.8" y2="118.3"/>
<text class="nj-charts-note" x="312.0" y="50.0" text-anchor="middle">#5882</text>
<line class="nj-charts-axis" x1="44" y1="208" x2="330" y2="208"/>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB