reactive-md 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/CHANGELOG-ch.md +333 -319
  2. package/CHANGELOG.md +334 -320
  3. package/CONTRIBUTING-ch.md +22 -22
  4. package/CONTRIBUTING.md +22 -22
  5. package/README-ch.md +431 -431
  6. package/README-en.md +431 -431
  7. package/README.md +429 -429
  8. package/SECURITY-ch.md +83 -83
  9. package/SECURITY.md +83 -83
  10. package/bin/reactive-md.mjs +39 -39
  11. package/cli/args.mjs +263 -263
  12. package/cli/assets.mjs +395 -395
  13. package/cli/build.mjs +445 -445
  14. package/cli/check.mjs +444 -444
  15. package/cli/document.mjs +130 -130
  16. package/cli/errors.mjs +61 -61
  17. package/cli/fs-utils.mjs +133 -133
  18. package/cli/glob.mjs +203 -203
  19. package/cli/help.mjs +323 -323
  20. package/cli/init.mjs +1577 -1577
  21. package/cli/lint.mjs +177 -177
  22. package/cli/main.mjs +65 -65
  23. package/cli/migrate.mjs +368 -368
  24. package/cli/package-loader.mjs +41 -41
  25. package/cli/package.mjs +211 -211
  26. package/dist-library/{LocalDocumentView-sthUP0ct.js → LocalDocumentView-BuqgJZEY.js} +11 -11
  27. package/dist-library/{LocalDocumentViewCore-GiWV3bey.js → LocalDocumentViewCore-DXE0I0Qc.js} +210 -209
  28. package/dist-library/{LocalReactiveDocumentCore-ZjQSGyHE.js → LocalReactiveDocumentCore-CWBe4Mm5.js} +8 -8
  29. package/dist-library/{authoring-Dsune4Hy.js → authoring-Ci_KzJ0q.js} +53 -53
  30. package/dist-library/{compile-wUv8KEge.js → compile-Dx6Uw3D9.js} +11 -11
  31. package/dist-library/{compiler-core-As_m-MNm.js → compiler-core-DDDdvuLy.js} +883 -818
  32. package/dist-library/compiler-dxLPB9Ym.js +86 -0
  33. package/dist-library/{component-state-C52ZFJGl.js → component-state-BRwvTV0d.js} +15 -14
  34. package/dist-library/component-state-CwKX_SN5.js +763 -0
  35. package/dist-library/{config-BadfhjdP.js → config-DXLvctiZ.js} +68 -66
  36. package/dist-library/config-validation-D3D7Dy2J.js +586 -0
  37. package/dist-library/{controls-CcT6n7k_.js → controls-DoZyLCrV.js} +3 -3
  38. package/dist-library/{coordinate-CWS9p5q_.js → coordinate-B1VFK9fd.js} +2 -2
  39. package/dist-library/{data-table-Bgccxd7h.js → data-table-8-3F15Jf.js} +3 -3
  40. package/dist-library/{default-components-BwQf0oP-.js → default-components-s21NevON.js} +29 -28
  41. package/dist-library/{display-B-VhqVND.js → display-B_uutKkN.js} +1 -1
  42. package/dist-library/{config-validation-F47AcE6o.js → document-theme-C8J6UyNO.js} +193 -731
  43. package/dist-library/{export-BqVmTXm8.js → export-CIAIPBov.js} +35 -34
  44. package/dist-library/{gallery-CY6mTx8i.js → gallery-Dv1rOvL0.js} +1 -1
  45. package/dist-library/{html-CNT4KD-2.js → html-Cr4CBwAH.js} +42 -41
  46. package/dist-library/identity-BUx0Q_-d.js +40 -0
  47. package/dist-library/{incremental-Dv0FSp_U.js → incremental-9nx92u9c.js} +12 -10
  48. package/dist-library/{layout-C0YlEPGr.js → layout-BBB2VF0S.js} +1 -1
  49. package/dist-library/{mount-preset-KxvtKgJb.js → mount-preset-DMZ5wd3t.js} +3 -3
  50. package/dist-library/observability-4KqXhIEU.js +421 -0
  51. package/dist-library/observability-core-Bcu7vpnl.js +24 -0
  52. package/dist-library/{options-1aDLK7JY.js → options-BBp9IcHm.js} +4 -4
  53. package/dist-library/{package-core-WFK1RhAZ.js → package-core-K5xesGqy.js} +30 -29
  54. package/dist-library/{parser-standard-Yuf3A_VI.js → parser-standard-CBA1-hdG.js} +352 -352
  55. package/dist-library/{plugin-packs-B1XPWcFs.js → plugin-packs-Bh1HhLym.js} +3 -2
  56. package/dist-library/preset-core-DeZPA8IE.js +1298 -0
  57. package/dist-library/react-0DCh-Mar.js +7 -0
  58. package/dist-library/reactive-md-authoring.js +19 -19
  59. package/dist-library/reactive-md-build.js +48 -10
  60. package/dist-library/reactive-md-compiler-standard.js +6 -6
  61. package/dist-library/reactive-md-compiler.js +3 -3
  62. package/dist-library/reactive-md-default-packs.js +3 -2
  63. package/dist-library/reactive-md-default-preset.js +3 -2
  64. package/dist-library/reactive-md-export.js +4 -4
  65. package/dist-library/reactive-md-minimal-preset.js +2 -2
  66. package/dist-library/reactive-md-minimal-react-preset.js +3 -3
  67. package/dist-library/reactive-md-observability.js +4 -0
  68. package/dist-library/reactive-md-plugin-chart.js +3 -3
  69. package/dist-library/reactive-md-plugin-data.js +5 -5
  70. package/dist-library/reactive-md-plugin-diagram.js +4 -4
  71. package/dist-library/reactive-md-plugin-forms.js +4 -4
  72. package/dist-library/reactive-md-plugin-gallery.js +3 -3
  73. package/dist-library/reactive-md-plugin-navigation.js +3 -3
  74. package/dist-library/reactive-md-plugin-network.js +4 -3
  75. package/dist-library/reactive-md-plugin-plot.js +4 -4
  76. package/dist-library/reactive-md-print.css +304 -304
  77. package/dist-library/reactive-md-react-minimal.js +4 -4
  78. package/dist-library/reactive-md-react-server.js +6 -6
  79. package/dist-library/reactive-md-react-unstyled.js +11 -11
  80. package/dist-library/reactive-md-react.js +11 -11
  81. package/dist-library/reactive-md-runtime-browser.js +2 -1
  82. package/dist-library/reactive-md-runtime.js +4 -3
  83. package/dist-library/reactive-md-sdk.js +8 -7
  84. package/dist-library/reactive-md-standalone-configured.js +2 -2
  85. package/dist-library/reactive-md-standalone-host.js +2 -2
  86. package/dist-library/reactive-md-testing-browser.js +2 -2
  87. package/dist-library/reactive-md-testing-react.js +6 -6
  88. package/dist-library/reactive-md-testing.js +5 -5
  89. package/dist-library/reactive-md.js +556 -367
  90. package/dist-library/{registry-B9NGct4d.js → registry-D6OGkOcX.js} +3 -3
  91. package/dist-library/{registry-core-Bbad9Bm2.js → registry-core-C9xOunaw.js} +1 -1
  92. package/dist-library/{resources-D2GDQS0p.js → resources-B0x_w3s9.js} +71 -46
  93. package/dist-library/{runtime-B2fxeveq.js → runtime-BDnnimPA.js} +17 -16
  94. package/dist-library/{runtime-kcA7bG7G.js → runtime-BpQdZmFI.js} +311 -305
  95. package/dist-library/{schema-BufhKUSM.js → schema-BryM_VRW.js} +14 -14
  96. package/dist-library/{sdk-core-BoJT1SIt.js → sdk-core-ChslheKs.js} +33 -32
  97. package/dist-library/{session-core-nmJHuR9c.js → session-core-dxQCJBNa.js} +15 -14
  98. package/dist-library/{shareable-DpbE-59H.js → shareable-B8xMoGEa.js} +179 -176
  99. package/dist-library/types/build/diagnostics.d.ts +1 -1
  100. package/dist-library/types/local/index.d.ts +6 -0
  101. package/dist-library/types/local/observability-codes.d.ts +2 -0
  102. package/dist-library/types/local/observability-core.d.ts +25 -0
  103. package/dist-library/types/local/observability-messages.d.ts +6 -0
  104. package/dist-library/types/local/observability.d.ts +43 -0
  105. package/dist-library/types/local/parsing/parser-internals.d.ts +2 -1
  106. package/dist-library/types/local/transport/worker.d.ts +52 -1
  107. package/dist-library/types/local/types.d.ts +8 -0
  108. package/dist-library/types/observability.d.ts +7 -0
  109. package/dist-library/{types-BeNtPqdY.js → types-Ib5kSScP.js} +1 -1
  110. package/dist-library/types-daDo2c_w.js +3 -0
  111. package/dist-library/{validation-BEBA_HvS.js → validation-B3RI0xOk.js} +251 -249
  112. package/dist-library/version-DAxuGOG2.js +147 -0
  113. package/dist-library/{visual-frame-CyV1FXzs.js → visual-frame-_rcd5HUv.js} +1 -1
  114. package/dist-library/{visuals-BZbZYA7w.js → visuals-DkDhNdEZ.js} +17 -17
  115. package/dist-standalone/reactive-md-standalone.js +118 -118
  116. package/docs/README-ch.md +101 -95
  117. package/docs/README.md +101 -95
  118. package/docs/compatibility/api-stability-ch.md +25 -0
  119. package/docs/compatibility/api-stability-en.md +25 -0
  120. package/docs/compatibility/compatibility-ch.md +146 -129
  121. package/docs/compatibility/compatibility-en.md +146 -129
  122. package/docs/compatibility/compatibility-manifest.schema.json +161 -0
  123. package/docs/compatibility/deprecation-ch.md +21 -0
  124. package/docs/compatibility/deprecation-en.md +21 -0
  125. package/docs/compatibility/source-versioning-ch.md +162 -162
  126. package/docs/compatibility/source-versioning-en.md +162 -162
  127. package/docs/compatibility/support-matrix-ch.md +108 -0
  128. package/docs/compatibility/support-matrix-en.md +108 -0
  129. package/docs/development/component-development-ch.md +66 -66
  130. package/docs/development/component-development-en.md +66 -66
  131. package/docs/development/component-development-reference-ch.md +253 -253
  132. package/docs/development/component-development-reference-en.md +238 -238
  133. package/docs/development/component-protocol-ch.md +748 -748
  134. package/docs/development/component-protocol-en.md +750 -750
  135. package/docs/development/extension-tutorial-ch.md +308 -308
  136. package/docs/development/extension-tutorial-en.md +308 -308
  137. package/docs/development/performance-overview-ch.md +422 -422
  138. package/docs/development/performance-overview-en.md +422 -422
  139. package/docs/guides/local-guide-ch.md +532 -532
  140. package/docs/guides/local-guide-en.md +532 -532
  141. package/docs/integration/author-tools-ch.md +64 -64
  142. package/docs/integration/author-tools-en.md +64 -64
  143. package/docs/integration/compiler-ch.md +49 -49
  144. package/docs/integration/compiler-en.md +36 -36
  145. package/docs/integration/directory-discovery-en.md +1 -1
  146. package/docs/integration/editor-ch.md +295 -295
  147. package/docs/integration/editor-en.md +303 -303
  148. package/docs/integration/extension-sdk-ch.md +394 -394
  149. package/docs/integration/extension-sdk-en.md +379 -379
  150. package/docs/integration/local-integration-ch.md +646 -646
  151. package/docs/integration/local-integration-en.md +662 -662
  152. package/docs/integration/shareable-export-ch.md +307 -307
  153. package/docs/integration/shareable-export-en.md +309 -309
  154. package/docs/reference/diagnostics-counting-ch.md +104 -104
  155. package/docs/reference/diagnostics-counting-en.md +104 -104
  156. package/docs/reference/html-compatibility-ch.md +93 -93
  157. package/docs/reference/html-compatibility-en.md +95 -95
  158. package/docs/reference/local-interaction-syntax-ch.md +724 -724
  159. package/docs/reference/local-interaction-syntax-en.md +722 -722
  160. package/docs/reference/public-api-ch.md +33 -4
  161. package/docs/reference/public-api-en.md +33 -4
  162. package/docs/reference/theme-protocol-ch.md +198 -198
  163. package/docs/reference/theme-protocol-en.md +217 -217
  164. package/docs/releases/release-0.4.0-ch.md +91 -91
  165. package/docs/releases/release-0.4.0-en.md +91 -91
  166. package/docs/releases/release-0.4.1-ch.md +25 -25
  167. package/docs/releases/release-0.4.1-en.md +25 -25
  168. package/docs/releases/release-0.5.0-ch.md +43 -43
  169. package/docs/releases/release-0.5.0-en.md +43 -43
  170. package/docs/releases/release-0.5.1-ch.md +41 -41
  171. package/docs/releases/release-0.5.1-en.md +41 -41
  172. package/docs/releases/release-0.5.2-ch.md +37 -37
  173. package/docs/releases/release-0.5.2-en.md +37 -37
  174. package/docs/releases/release-0.5.3-ch.md +26 -26
  175. package/docs/releases/release-0.5.3-en.md +26 -26
  176. package/docs/releases/release-0.6.0-ch.md +59 -59
  177. package/docs/releases/release-0.6.0-en.md +59 -59
  178. package/docs/releases/release-0.6.1-ch.md +29 -29
  179. package/docs/releases/release-0.6.1-en.md +29 -29
  180. package/docs/releases/release-0.7.0-ch.md +86 -86
  181. package/docs/releases/release-0.7.0-en.md +86 -86
  182. package/docs/releases/release-0.9.2-ch.md +33 -0
  183. package/docs/releases/release-0.9.2-en.md +33 -0
  184. package/examples/component-package/README-ch.md +101 -101
  185. package/examples/component-package/README.md +133 -133
  186. package/examples/conformance/README-ch.md +55 -55
  187. package/examples/conformance/README.md +55 -55
  188. package/examples/conformance/component-protocol-1.json +482 -482
  189. package/examples/conformance/component-protocol-1.schema.json +76 -76
  190. package/examples/conformance/local-draft-1.json +50 -50
  191. package/examples/conformance/local-draft-2.json +212 -212
  192. package/examples/game-2048-package/LICENSE +21 -21
  193. package/examples/game-2048-package/NOTICES.md +11 -11
  194. package/examples/game-2048-package/README-ch.md +91 -91
  195. package/examples/game-2048-package/README.md +98 -98
  196. package/examples/game-2048-package/package.json +35 -35
  197. package/examples/game-2048-package/sample/document.reactive.md +17 -17
  198. package/examples/game-2048-package/scripts/build-export.mjs +44 -44
  199. package/examples/game-2048-package/scripts/build.mjs +130 -130
  200. package/examples/game-2048-package/scripts/verify.mjs +180 -180
  201. package/examples/game-2048-package/src/component.css +161 -161
  202. package/examples/game-2048-package/src/components.tsx +326 -326
  203. package/examples/game-2048-package/src/game-engine.ts +228 -228
  204. package/examples/game-2048-package/src/harness.tsx +34 -34
  205. package/examples/game-2048-package/src/manifest.ts +85 -85
  206. package/examples/game-2048-package/src/node-entry.ts +30 -30
  207. package/examples/game-2048-package/src/sample.ts +4 -4
  208. package/examples/game-2048-package/tsconfig.json +15 -15
  209. package/examples/integration/README-ch.md +82 -82
  210. package/examples/integration/README.md +82 -82
  211. package/examples/integration/core/index.mjs +32 -32
  212. package/examples/integration/extension-sdk/README-ch.md +24 -24
  213. package/examples/integration/extension-sdk/README.md +24 -24
  214. package/examples/integration/worker/index.html +19 -19
  215. package/examples/integration/worker/main.js +61 -61
  216. package/examples/integration/worker/package.json +13 -13
  217. package/examples/integration/worker/worker.js +3 -3
  218. package/examples/local/README-ch.md +76 -76
  219. package/examples/local/README.md +76 -76
  220. package/examples/local/charts.reactive.md +73 -73
  221. package/examples/local/recipes/invoice-zh.reactive.md +36 -36
  222. package/examples/local/recipes/invoice.reactive.md +36 -36
  223. package/examples/local/recipes/workshop-zh.reactive.md +33 -33
  224. package/examples/local/recipes/workshop.reactive.md +33 -33
  225. package/examples/local/showcase/README-ch.md +22 -22
  226. package/examples/local/showcase/README.md +31 -31
  227. package/examples/local/showcase/explore.reactive.md +102 -102
  228. package/examples/local/showcase/flow.reactive.md +86 -86
  229. package/examples/local/showcase/forms.reactive.md +126 -126
  230. package/examples/local/showcase/functions.reactive.md +119 -119
  231. package/examples/local/showcase/layout.reactive.md +100 -100
  232. package/examples/local/showcase/statistics.reactive.md +108 -108
  233. package/examples/local/showcase/tasks.reactive.md +89 -89
  234. package/examples/local/showcase/zh/explore.reactive.md +102 -102
  235. package/examples/local/showcase/zh/flow.reactive.md +86 -86
  236. package/examples/local/showcase/zh/forms.reactive.md +126 -126
  237. package/examples/local/showcase/zh/functions.reactive.md +119 -119
  238. package/examples/local/showcase/zh/layout.reactive.md +100 -100
  239. package/examples/local/showcase/zh/statistics.reactive.md +108 -108
  240. package/examples/local/showcase/zh/tasks.reactive.md +89 -89
  241. package/examples/minimal-extension/README-ch.md +78 -78
  242. package/examples/minimal-extension/README.md +78 -78
  243. package/examples/minimal-extension/index.html +15 -15
  244. package/examples/minimal-extension/package.json +26 -26
  245. package/examples/minimal-extension/sample/document.reactive.md +10 -10
  246. package/examples/minimal-extension/scripts/build.mjs +32 -32
  247. package/examples/minimal-extension/scripts/export.mjs +72 -72
  248. package/examples/minimal-extension/scripts/test-node.mjs +75 -75
  249. package/examples/minimal-extension/src/extension.tsx +90 -90
  250. package/examples/minimal-extension/src/preview.tsx +12 -12
  251. package/examples/minimal-extension/src/source.ts +4 -4
  252. package/examples/minimal-extension/tsconfig.json +14 -14
  253. package/examples/sci-fi-theme/README-ch.md +133 -133
  254. package/examples/sci-fi-theme/README.md +148 -148
  255. package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -454
  256. package/examples/sci-fi-theme/demo/demo.css +638 -638
  257. package/examples/sci-fi-theme/demo/document.reactive.md +206 -206
  258. package/examples/sci-fi-theme/demo/index.html +13 -13
  259. package/examples/sci-fi-theme/demo/main.tsx +215 -215
  260. package/examples/sci-fi-theme/docs/design-system-ch.md +245 -245
  261. package/examples/sci-fi-theme/docs/design-system.md +474 -474
  262. package/examples/sci-fi-theme/package.json +28 -28
  263. package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -98
  264. package/examples/sci-fi-theme/src/components.css +2370 -2370
  265. package/examples/sci-fi-theme/src/index.ts +6 -6
  266. package/examples/sci-fi-theme/src/notch.css +142 -142
  267. package/examples/sci-fi-theme/src/sci-fi.css +7 -7
  268. package/examples/sci-fi-theme/src/theme.ts +39 -39
  269. package/examples/sci-fi-theme/tsconfig.json +20 -20
  270. package/examples/sci-fi-theme/vite.config.ts +24 -24
  271. package/examples/tetris-package/LICENSE +21 -21
  272. package/examples/tetris-package/NOTICES.md +11 -11
  273. package/examples/tetris-package/README-ch.md +91 -91
  274. package/examples/tetris-package/README.md +95 -95
  275. package/examples/tetris-package/package.json +35 -35
  276. package/examples/tetris-package/sample/document.reactive.md +16 -16
  277. package/examples/tetris-package/scripts/build-export.mjs +44 -44
  278. package/examples/tetris-package/scripts/build.mjs +130 -130
  279. package/examples/tetris-package/scripts/verify.mjs +173 -173
  280. package/examples/tetris-package/src/component.css +145 -145
  281. package/examples/tetris-package/src/components.tsx +334 -334
  282. package/examples/tetris-package/src/harness.tsx +34 -34
  283. package/examples/tetris-package/src/manifests.ts +93 -93
  284. package/examples/tetris-package/src/node-entry.ts +16 -16
  285. package/examples/tetris-package/src/sample.ts +4 -4
  286. package/examples/tetris-package/src/tetris-engine.ts +325 -325
  287. package/examples/tetris-package/tsconfig.json +15 -15
  288. package/package.json +7 -1
  289. package/dist-library/compiler-eOfcinZs.js +0 -62
  290. package/dist-library/component-state-BoLCGee4.js +0 -801
  291. package/dist-library/preset-core-CKc5YXSM.js +0 -1443
  292. package/dist-library/react-D5iGiUdL.js +0 -7
@@ -1,422 +1,422 @@
1
- # Performance optimization and current measurement overview
2
-
3
- **English** · [中文](performance-overview-ch.md)
4
-
5
- Re-tested 2026-11-20. Part 1 preserves each round's original record. Part 2's compilation, long-document editing, mixed parsing, incremental sessions, Worker, runtime stages and memory tables were re-measured on the 0.8.0 codebase at commit `8b0ccdc`; the full matrix was run twice on the same machine and the tables use the second pass. The editor and demo now live in separate repositories, so the CM6 full-editor, React rendering and targeted A/B comparisons cannot be re-run here; their 2026-10-29 records are retained and marked.
6
-
7
- ## 1. Direction and outcome of each optimization round
8
-
9
- The records below are as of each optimization. Cold compilation, steady-state editing and input-to-frame opportunity use different bases, so these numbers cannot be chained into a single speedup ratio. The current full matrix and the 2026-10-29 targeted re-measurements are in part two.
10
-
11
-
12
- | Commit | Direction | Optimization outcome at the time and basis |
13
- | --- | --- | --- |
14
- | ea80662 | Ordinary paragraphs produce a LocalNode directly; Markdown without replacements reuses the first-pass AST, avoiding duplicate parsing and per-character mapping | Relative to df59896, first compilation of 5000 ordinary paragraphs 517.4 → 87.0 ms; 100k paragraphs rejected under the default budget 16339.7 → 29.9 ms, peak RSS 1003.8 → 69.4 MiB; after raising the budget to 250k nodes, successful compilation 19918.7 → 2297.8 ms. All are first calls in an independent Node process. |
15
- | 6ac6916 | Added a block-level incremental session that locates changes with Lezer TreeFragment and keeps unmodified blocks; wired into the Worker, fallback compilation and React component | Full and incremental measured as pairs in the same build, 3 warmups and 15 measurements. A 600-section article 1030.09 → 30.65 ms, compiling only 1 block and reusing 1799; 5000 ordinary paragraphs 60.20 → 15.99 ms. Establishing a session for the first time has additional cost. |
16
- | fb05509 | Deferred block-cache rebuilds during consecutive component-context changes; fast scanning for simple lists and tables; fewer copies of private results | Compared against the production package saved before the change. 100-item list session edit 15.08 → 5.70 ms, 200×4 table 30.78 → 10.82 ms (21 measurements); of 200 consecutive context changes the last 199 build no index, and restoring the body builds one. |
17
- | 658a3b6 | Contiguous range mapping and shared row index; per-block fast/general dispatch; direct node production and upfront budgets; parse and semantic caches; shared results, bidirectional Worker patches, runtime reuse and cancellable idle preparation | Relative to fb05509, inside a container a 256k-indented long line 9846.93 → 25.09 ms, 80 mixed blocks 82.21 → 39.61 ms. Browser component-context Worker 80 → 60 ms, body 29 → 11 ms. The dynamic list preview regressed once from 394.3 to 503.5 ms; patches for huge lists and tables are still close to full results. |
18
- | 047b547 | 20 ms Demo debounce; retained preview and runtime, stable highlighting and reference keys; later top-level paragraphs use content-visibility:auto | Relative to the production package and Demo snapshot saved before that round's change, the old full editor's input-to-frame opportunity: 800 dynamic paragraphs 705.5 → 182.5 ms; 2400 paragraphs 2401.9 → 644.6 ms; 1000-row dynamic table 837.1 → 446.3 ms (median, 15 samples). The baseline already includes earlier optimizations and is not the original fb05509. |
19
- | f7a7ab8 | Introduced CM6 and made it the Demo default; source creates DOM per viewport; shared Worker author analysis; fixed const/computed and HTML syntax highlighting, restored the old color scheme | Two editors on the same prototype package: 800 paragraphs input-to-frame opportunity 93.7 → 15.0 ms, source DOM 4015 → 294; 2400 paragraphs 301.7 → 24.0 ms, DOM 12015 → 294; 1000-row dynamic table 223.8 → 16.5 ms. These are prototype records; this round re-measured through the single CM6 entry point. |
20
- | 4a8f1ea | The previous-block row plan avoids the 512-entry LRU order scan on eviction; keeps unmodified row IDs and objects, updating ranges on shifts; sends a full success result instead of an unprofitable patch; copies short strings in caches; removed the old textarea source editor | A/B, real preview DOM, cache memory and the CM6 full matrix are below. /editor and /editor/codemirror share components, styles and runtime; the old textareaRef/getTextarea are removed, and the document form textarea remains supported. |
21
- | This round (based on 4a8f1ea) | Simple dynamic rows reuse the validated placeholder plan, and the first-pass masking scan also skips Markdown inside expressions; deep node traversal, snapshot publishing, dependency summaries, runtime and view indexing use explicit stacks; negotiated flat result transfer; deep single-child container chains use fewer React memo wrappers | Compilation and preview comparisons for dynamic lists and tables are in the targeted re-measurement. Real Edge passed compilation and transfer of 1000-level references, lists and mixed nesting, and deep preview edits preserve parameter 13; 1001-level Markdown is rejected by budget. |
22
-
23
-
24
- This round also confirmed a cache retention problem: short row strings could indirectly reference the old full text. Before the fix, for the same 1000-item list, the post-GC heap grew from 23.52 to 27.54 MiB between edits 100 and 200; after copying cache keys and inline token text, an independent re-measurement gave 20.26 → 20.34 MiB. A formal 500-edit long-row measurement follows below.
25
-
26
- The historical implementation basis includes Lezer's incremental fragments, GFM container rules and CM6 viewport management; these approaches fall back conservatively according to current semantics. Reference definitions, footnotes, HTML, BOM, declaration or container context changes and code delimiter changes can still trigger a full compilation. This round brings simple dynamic interpolation rows into the fast path; links, escapes, nesting and complex inline formatting continue to fall back per block.
27
-
28
- ## 2. Current compilation and rendering performance overview
29
-
30
- ### Measurement conditions and coverage
31
-
32
- Node v22.17.0, Intel(R) Core(TM) Ultra 5 125H, Windows x64. Node stress scenarios use independent processes with a 1 GiB old-generation cap; the browser is Edge 135.0.3179.66 in headless mode at a 1440×1000 viewport. Daily development processes remain running on the machine; power policy and CPU frequency were not pinned. Performance scripts run serially. This round was re-run on 2026-11-20 on the same machine; two full matrices were run back to back and several scenarios varied in both directions, so the tables use the second pass and its per-sample data is in the summary. Stages that depend on the demo or editor repositories were not included.
33
-
34
- Typically 3 warmups and 15 measurements; the long-line and dedicated over-budget cases use 5/3, and the independent browser Worker uses 2 warmups and 5 measurements; the summary data is authoritative. P95 uses the nearest rank, which equals the maximum sample at 15 samples and is used only to observe the tail. First calls, public snapshot copies, shared Worker results and main-thread rendering are recorded separately.
35
-
36
- RSS is the process high-water mark and includes Node, modules, input and temporary objects; the post-GC heap is the retained amount, and the two are not interchangeable. JSON UTF-8 message size is an estimate; structured-clone cost is measured separately. Input-to-preview ends at the second requestAnimationFrame frame opportunity after commit; CDP Paint is a paint-phase event, and neither indicates GPU display completion. React phases overlap and cannot be summed.
37
-
38
- ### Targeted re-measurement from 2026-10-29: dynamic rows and deep nesting (historical, not re-run)
39
-
40
- The baseline is the `4a8f1ea` production package saved at the start of that round, and post-change data comes from that round's final build; code hashes and condensed results are in `benchmarks/dynamic-depth-2026-10-29.json`. That round re-measured dynamic lists, dynamic tables, deep containers, protocol recovery and sustained-edit memory. The original record is kept here; current measurements are in the tables below.
41
-
42
- Each browser group uses 3 warmups and 15 measurements. Before-change samples are retained from that round's first paired measurement, and after-change samples were re-measured on the final build. The table shows median/P95 in ms. Input is driven by an independent textarea fixture to compare the Worker-to-React preview path; CM6 and deep preview get separate real-browser functional verification.
43
-
44
- | Dynamic scenario | Worker compile, before → after | Input to preview frame opportunity, before → after | Median response size, before → after |
45
- | --- | --- | --- | --- |
46
- | 1000-item dynamic list | 268/342 → 175/253 | 339.6/408.9 → 280.6/396.7 | 15444 → 15453 B |
47
- | 500-row dynamic table | 213/310 → 66/89 | 286/373.1 → 134.4/159.1 | 8688 → 8693 B |
48
-
49
- Node in-process Worker-handler comparisons also use 3 warmups and 15 measurements; the table below lists only the compilation phase and excludes patch encoding, cloning or React.
50
-
51
- | Scenario | Compile median/P95, before → after ms |
52
- | --- | --- |
53
- | 1000-item dynamic list, equal-length edit | 148/212 → 104/129 |
54
- | 1000-item dynamic list, shift edit | 195/291 → 266/368 |
55
- | 500-row dynamic table, equal-length edit | 111/202 → 86/106 |
56
- | 500-row dynamic table, shift edit | 115/230 → 110/185 |
57
-
58
- This batch's Node shift list regressed; a separate new-process comparison gave 324/508 → 124/255 ms. Both batches show clear jitter, so all raw results are kept and that round computes no unified speedup ratio. The browser table uses final-build measurements.
59
-
60
- Deep Node comparisons use independent processes, 1 warmup and 3 measurements, through the public `compileLocal()` path. The component limit remains 100 levels and the Markdown limit 1000 levels; over-limit rows record rejection time.
61
-
62
- | Scenario and result | Compile median, before → after ms | First-call peak RSS, before → after MiB |
63
- | --- | --- | --- |
64
- | containers-50, success | 37.38 → 16.87 | 71.28 → 67.26 |
65
- | containers-100, success | 109.42 → 32.91 | 81.17 → 70.29 |
66
- | containers-101, local.budget.nesting | 107.89 → 11.14 | 79.43 → 67.12 |
67
- | containers-1000, local.budget.nesting | 4587.18 → 88.83 | 138.18 → 97.64 |
68
- | markdown-depth-500, success | 10.25 → 12.37 | 67.17 → 67.19 |
69
- | markdown-depth-1000, success | 22.29 → 20.08 | 77.91 → 76.86 |
70
- | markdown-depth-1500, local.budget.markdown-depth | 3.19 → 2.8 | 64.17 → 64.04 |
71
-
72
- 500-level blockquotes are slightly slower in this batch of Node measurements; the main gain of the deep work is fewer duplicate parses of component bodies, earlier termination of over-limit input, and removal of browser call-stack and result-transfer failures. A 1000-level list still takes hundreds of milliseconds, and general container parsing still has room for improvement.
73
-
74
- The real Edge module Worker passed 100/500/1000-level blockquotes, 1000-level lists and 500 groups of mixed reference/list nesting, and leaf expressions were correct after deep edits. A corrupted flat frame recovers with exactly one full request, after which a 1001-level budget rejection and an ordinary document return to normal. CM6 and the React preview passed 500/1000-level references, 1000-level unordered/ordered lists and mixed nesting; the original DOM depth is preserved, the expression edited from `n * 2` to `n * 3` displays 39, the parameter stays 13, only one Worker is created, and page and console errors are empty.
75
-
76
- The implementation includes three constraints: the fast plan validates placeholder positions and types produced by the current parse every time, and the first-pass expression masking plan only supplies Markdown facts and must not generate body nodes; deep results negotiate `flatResults: "flat-v1"` into flat records plus references, while ordinary documents keep the existing patches; single-child Markdown container chains above 32 levels build native wrappers iteratively, reducing React memo component layers while preserving native DOM structure. Copying, sharing, flat encoding/decoding, runtime indexing and view projection of 6000-level data have separate unit verification.
77
-
78
- A 1000-item dynamic list edited 500 times consecutively: post-GC heap growth over edits 50–500 is 0.463 MiB, retained heap 18.146 MiB, and 13.095 MiB after releasing the session; the parse cache ends at 524 entries, still within the 672-entry cap.
79
-
80
- The implementation references [Lezer's context and incremental reuse constraints](https://lezer.codemirror.net/docs/guide/) and [V8's iterative traversal approach](https://v8.dev/blog/json-stringify). Flat records reference [the object index table of @ungap/structured-clone](https://github.com/ungap/structured-clone/blob/main/esm/serialize.js); that implementation's visitor is still recursive, whereas this round implements iterative traversal for the compiler's ordinary data with no new dependency.
81
-
82
- That round's gates: 116 core test files with 1534 tests and 16 Demo files with 254 tests pass; type checking, production/standalone/declaration builds, Demo builds, public package checks and offline packed consumption pass; documentation links and `git diff --check` pass. The deep stress unit tests set a separate 30-second timeout, and performance statistics come from production-package scripts.
83
-
84
- Reproduce the targeted tests (the commands below belong to that round; the CM6 fixture used by `--preview` moved to the editor repository):
85
-
86
- ```powershell
87
- npm run build
88
- node scripts/benchmark-row-reuse.mjs --case=dynamic --out=artifacts/dynamic-depth/rows-after-final.json
89
- node scripts/verify-deep-worker-browser.mjs --preview
90
- $env:EDITING_BEFORE="artifacts/dynamic-depth/before-library"
91
- $env:EDITING_DYNAMIC_ROWS="1"
92
- $env:EDITING_CASES="list,table"
93
- node scripts/benchmark-editing-comparison.mjs
94
- $env:EDITING_MEMORY_CASES="longRows"
95
- $env:EDITING_MEMORY_REPORT="artifacts/dynamic-depth/dynamic-memory.json"
96
- node scripts/benchmark-editing-memory.mjs
97
- ```
98
-
99
- Per-sample results and failure reproductions are kept in `artifacts/dynamic-depth/`. The old-package snapshot is a local artifact; re-running the comparison requires saving an identical baseline production package first.
100
-
101
- ### Full compilation and extreme input (8b0ccdc, 45 scenarios)
102
-
103
- Calls the public compileLocal; timing includes final result construction and excludes input generation, checking and GC. The node budget defaults to 10000; scenarios marked raised use 250000. Character counts are UTF-16 code units. Budget rejections are listed separately as expected outcomes, and all scenarios should exit normally.
104
-
105
-
106
- | Scenario ID | Characters | Result / nodes | First ms | Steady-state median / P95 ms | First-call peak RSS MiB |
107
- | --- | --- | --- | --- | --- | --- |
108
- | plain-10000 | 10000 | success / 2 | 12.14 | 0.17 / 0.83 | 67.89 |
109
- | plain-100000 | 100000 | success / 2 | 18.77 | 0.62 / 1.32 | 69.16 |
110
- | plain-500000 | 500000 | success / 2 | 22.23 | 3.73 / 6.79 | 70.13 |
111
- | plain-1000000 | 1000000 | success / 2 | 21.02 | 5.36 / 6.59 | 71.16 |
112
- | plain-1000001 | 1000001 | local.budget.document | 9.21 | 0.05 / 0.21 | 69.45 |
113
- | article-10 | 1598 | success / 161 | 61.92 | 6.33 / 11.67 | 73.51 |
114
- | article-100 | 15550 | success / 1601 | 125.82 | 28.62 / 42.80 | 83.66 |
115
- | article-600 | 94050 | success / 9601 | 450.76 | 339.55 / 406.06 | 125.39 |
116
- | article-2000 | 315852 | local.budget.nodes | 738.17 | 518.00 / 829.54 | 160.56 |
117
- | article-2000-raised | 315852 | success / 32001 | 1147.08 | 838.71 / 1054.24 | 177.64 |
118
- | controls-1000 | 68779 | success / 1000 | 264.14 | 136.45 / 156.61 | 119.97 |
119
- | controls-5000 | 352779 | success / 5000 | 921.47 | 831.04 / 905.37 | 206.09 |
120
- | controls-10000 | 707779 | success / 10000 | 1745.31 | 1477.54 / 1791.96 | 342.32 |
121
- | controls-10001 | 707852 | local.budget.nodes | 197.23 | 149.45 / 173.64 | 115.06 |
122
- | controls-12000 | 853779 | local.budget.nodes | 259.77 | 179.85 / 215.00 | 119.33 |
123
- | controls-10000-raised | 707779 | success / 10000 | 1652.14 | 1502.26 / 1986.24 | 338.87 |
124
- | controls-12000-raised | 853779 | success / 12000 | 2195.87 | 1897.38 / 2221.06 | 391.69 |
125
- | shared-controls-5000 | 270000 | success / 5000 | 845.98 | 629.16 / 813.83 | 215.34 |
126
- | conflicting-controls-5000 | 329999 | local.initial.duplicate-peers | 856.53 | 684.66 / 872.58 | 198.07 |
127
- | expressions-1000 | 21960 | success / 4001 | 259.66 | 84.07 / 131.19 | 106.48 |
128
- | expressions-5000 | 113960 | local.budget.nodes | 435.23 | 194.96 / 225.71 | 146.44 |
129
- | expressions-5000-raised | 113960 | success / 20001 | 712.13 | 502.46 / 696.91 | 157.50 |
130
- | paragraphs-1000 | 6000 | success / 2000 | 35.12 | 10.68 / 18.20 | 78.88 |
131
- | paragraphs-5000 | 30000 | success / 10000 | 101.65 | 54.03 / 60.55 | 92.74 |
132
- | paragraphs-10000 | 60000 | local.budget.nodes | 18.27 | 1.79 / 7.25 | 72.91 |
133
- | paragraphs-20000 | 120000 | local.budget.nodes | 17.83 | 2.33 / 4.25 | 72.98 |
134
- | paragraphs-100000 | 600000 | local.budget.nodes | 23.95 | 6.92 / 11.95 | 79.15 |
135
- | paragraphs-100000-raised | 600000 | success / 200000 | 1839.39 | 2007.70 / 2364.49 | 291.53 |
136
- | formatted-paragraphs-5000 | 285000 | local.budget.nodes | 609.26 | 507.34 / 594.79 | 176.37 |
137
- | formatted-paragraphs-5000-raised | 285000 | success / 40000 | 1012.14 | 828.23 / 981.74 | 206.25 |
138
- | containers-50 | 956 | success / 52 | 75.31 | 16.42 / 19.85 | 79.57 |
139
- | containers-100 | 1906 | success / 102 | 106.02 | 33.63 / 40.69 | 82.22 |
140
- | containers-101 | 1925 | local.budget.nesting | 57.15 | 11.00 / 20.12 | 77.44 |
141
- | containers-1000 | 19006 | local.budget.nesting | 213.41 | 110.43 / 134.72 | 101.30 |
142
- | unclosed-1000 | 9004 | local.budget.nesting | 130.10 | 63.69 / 81.02 | 82.53 |
143
- | markdown-depth-100 | 204 | success / 102 | 35.97 | 3.03 / 5.84 | 70.54 |
144
- | markdown-depth-500 | 1004 | success / 502 | 53.59 | 8.77 / 14.23 | 78.91 |
145
- | markdown-depth-1000 | 2004 | success / 1002 | 80.30 | 19.77 / 31.34 | 86.86 |
146
- | markdown-depth-1500 | 3004 | local.budget.markdown-depth | 25.95 | 1.89 / 5.13 | 72.34 |
147
- | markdown-depth-2000 | 4004 | local.budget.markdown-depth | 30.74 | 2.49 / 4.45 | 73.88 |
148
- | markdown-depth-5000 | 10004 | local.budget.markdown-depth | 49.46 | 4.97 / 7.78 | 82.66 |
149
- | math-1000 | 16000 | success / 2000 | 406.93 | 194.00 / 218.00 | 121.20 |
150
- | table-1000 | 28910 | success / 5008 | 196.79 | 60.20 / 80.78 | 96.14 |
151
- | computed-chain-1000 | 45839 | success / 3 | 296.67 | 137.38 / 168.25 | 118.54 |
152
- | computed-chain-5000 | 237839 | success / 3 | 902.24 | 625.79 / 751.97 | 208.96 |
153
-
154
-
155
- ### Long-document editing across block types (24 scenarios)
156
-
157
- The same target block sits among 1000 ordinary paragraphs; version numbers have fixed width, and the fenced-delimiter scenario actively changes the boundary. Independent process per scenario, alternating full compilation and session compilation order. The table includes the cost of publishing an independent public snapshot; syntax highlighting, plot sampling and DOM layout are outside this table.
158
-
159
- | Target block | Single-block full ms | Long-document full ms | Session median / P95 ms | Final mode | Reused blocks |
160
- | --- | --- | --- | --- | --- | --- |
161
- | Ordinary paragraph, about 512 characters | 0.22 | 11.05 | 15.21 / 22.42 | incremental | 1000 |
162
- | Ordinary paragraph, about 8 Ki characters | 0.24 | 9.90 | 15.94 / 21.03 | incremental | 1000 |
163
- | Formatted paragraph, about 512 characters | 3.36 | 40.03 | 20.27 / 23.92 | incremental | 1000 |
164
- | Level-2 heading, about 80 characters | 0.83 | 37.30 | 16.83 / 20.78 | incremental | 1000 |
165
- | Unordered list, 20 items | 1.93 | 23.12 | 14.36 / 22.48 | incremental | 1000 |
166
- | Unordered list, 100 items | 7.19 | 25.18 | 20.96 / 29.45 | incremental | 1000 |
167
- | Ordered list, 20 items | 1.66 | 22.02 | 15.24 / 20.90 | incremental | 1000 |
168
- | Markdown table, 20×4 | 2.43 | 22.43 | 15.41 / 20.44 | incremental | 1000 |
169
- | Markdown table, 100×4 | 5.72 | 32.02 | 26.48 / 33.35 | incremental | 1000 |
170
- | Markdown table, 200×4 | 15.04 | 37.64 | 33.75 / 63.07 | incremental | 1000 |
171
- | Blockquote, 10 paragraphs | 2.12 | 33.93 | 14.74 / 22.42 | incremental | 1000 |
172
- | Fenced code, 60 lines | 1.64 | 39.44 | 17.34 / 21.56 | incremental | 1000 |
173
- | Fenced code, 300 lines | 3.47 | 41.13 | 18.93 / 23.55 | incremental | 1000 |
174
- | Indented code, 60 lines | 1.58 | 93.63 | 20.17 / 41.95 | incremental | 1000 |
175
- | Display formula, 20 items | 3.53 | 72.09 | 19.64 / 35.87 | incremental | 1000 |
176
- | Display formula, 80 items | 8.07 | 72.58 | 24.87 / 42.12 | incremental | 1000 |
177
- | Expression paragraph, 20 interpolations | 2.51 | 68.18 | 18.68 / 32.43 | incremental | 1000 |
178
- | Slider initial value change | 1.73 | 79.63 | 91.34 / 144.33 | full | 0 |
179
- | Panel interior, 50 paragraphs | 6.03 | 79.72 | 74.44 / 83.49 | full | 0 |
180
- | ReactiveMD table, 20×4 | 4.87 | 77.61 | 96.41 / 127.31 | full | 0 |
181
- | Bar chart data, 20 rows | 4.29 | 67.02 | 81.17 / 105.50 | full | 0 |
182
- | Plot formula, 1 curve | 3.64 | 71.66 | 84.50 / 112.96 | full | 0 |
183
- | Diagram node body, 20 nodes | 9.06 | 66.52 | 70.31 / 107.23 | full | 0 |
184
- | Fenced delimiter change, 60 lines of code | 1.49 | 39.16 | 54.30 / 68.21 | full | 0 |
185
-
186
-
187
- ### Fast/general mixed parsing and long lines
188
-
189
- Covers simple blocks interleaved with links and escapes, native and component tables, dynamic cells, 5000 controls, very long indented lines inside containers, and large over-budget lists.
190
-
191
- | Scenario | Median / P95 ms | Process peak RSS MiB |
192
- | --- | --- | --- |
193
- | ordinary-1000 | 12.81 / 19.20 | 108.34 |
194
- | mixed-80 | 53.82 / 67.16 | 167.36 |
195
- | table-1000 | 84.78 / 97.55 | 178.88 |
196
- | component-table-500 | 41.29 / 64.94 | 163.93 |
197
- | component-dynamic-table-500 | 35.70 / 40.62 | 119.51 |
198
- | controls-5000 | 671.72 / 1066.59 | 548.40 |
199
- | indented-line-16000 | 10.64 / 12.23 | 93.00 |
200
- | indented-line-64000 | 21.97 / 31.13 | 91.98 |
201
- | indented-line-256000 | 75.08 / 85.49 | 89.41 |
202
- | over-budget-list-50000 | 349.35 / 352.36 | 532.13 |
203
-
204
-
205
- Cache recovery of an independent body after 200 consecutive component-context changes:
206
-
207
- | Context edit median / P95 ms | Index rebuilds during consecutive changes | Restore body ms | Index builds during restore |
208
- | --- | --- | --- | --- |
209
- | 52.80 / 93.53 | 0 | 124.58 | 1 |
210
-
211
-
212
- Full compilation scale for pure blocks:
213
-
214
- | Scenario | Median / P95 ms | Peak RSS MiB |
215
- | --- | --- | --- |
216
- | bullet-100 | 8.27 / 14.95 | 84.77 |
217
- | bullet-500 | 26.40 / 31.44 | 133.75 |
218
- | bullet-1500 | 90.62 / 124.96 | 191.04 |
219
- | table-100 | 8.71 / 14.94 | 100.35 |
220
- | table-500 | 39.94 / 49.41 | 142.10 |
221
- | table-1000 | 89.38 / 133.26 | 195.25 |
222
- | component-table-100 | 12.16 / 20.38 | 103.84 |
223
- | component-table-500 | 46.24 / 61.33 | 145.66 |
224
-
225
-
226
- Full compilation versus session editing in the same build, including full snapshot publishing:
227
-
228
- | Document | Full median ms | Session median ms | First session ms | Compiled / reused blocks |
229
- | --- | --- | --- | --- | --- |
230
- | paragraphs-5000 | 70.04 | 81.39 | 365.93 | 1 / 4999 |
231
- | formatted-paragraphs-1000 | 147.40 | 58.84 | 390.44 | 1 / 999 |
232
- | article-600 | 213.85 | 74.87 | 609.83 | 1 / 1799 |
233
- | article-2000 | 767.36 | 271.56 | 1196.28 | 1 / 5999 |
234
-
235
-
236
- ### Row reuse and patch cost (8b0ccdc)
237
-
238
- The current production package runs the production Worker handler inside Node, one session per scenario, 3 warmups and 15 measurements; responses are applied only after structuredClone. Worker timing excludes cross-thread transfer; the clone column is local copy time. equal is a fixed-length middle edit, shift alternately adds and removes characters and shifts later ranges, and rewrite changes every row.
239
-
240
- | Scenario | Worker median ms | Compile median ms | Encode median ms | Clone median ms | Patch apply ms | Response B | Shared nodes |
241
- | --- | --- | --- | --- | --- | --- | --- | --- |
242
- | list-equal | 86.07 | 79.00 | 6.00 | 0.15 | 4.13 | 14900 | 5998 |
243
- | list-shift | 116.62 | 110.00 | 5.00 | 0.49 | 5.71 | 38001 | 3002 |
244
- | table-equal | 50.50 | 47.00 | 4.00 | 0.16 | 3.05 | 8565 | 3504 |
245
- | table-shift | 68.20 | 59.00 | 9.00 | 0.45 | 3.45 | 20156 | 1759 |
246
- | dynamic-list-equal | 167.81 | 157.00 | 10.00 | 0.27 | 6.39 | 15436 | 7997 |
247
- | dynamic-list-shift | 204.73 | 197.00 | 10.00 | 0.69 | 7.92 | 38536 | 4003 |
248
- | dynamic-table-equal | 60.61 | 57.00 | 4.00 | 0.19 | 2.68 | 8681 | 3505 |
249
- | dynamic-table-shift | 66.12 | 63.00 | 3.00 | 0.36 | 3.01 | 20274 | 1760 |
250
- | paragraphs-equal | 8.41 | 7.00 | 1.00 | 0.11 | 1.19 | 11184 | 1602 |
251
- | list-rewrite | 127.97 | 104.00 | 28.00 | 21.97 | 0.00 | 906084 | 0 |
252
-
253
- Equal-length single-row edits mainly reduce transfer, main-thread patch application and React node replacement. Shift edits must update later ranges and still clone objects; a whole-block rewrite encodes first and then decides to send a full result, so Worker encoding cost may rise. Real-browser end-to-end latency is in the next section; Node handler data cannot replace it.
254
-
255
- The 2026-10-29 round ran the same comparison against a saved f7a7ab8 production package. That baseline is not retained in this repository, so it was not re-run this round; its results remain in `benchmarks/performance-overview-2026-10-29.json`.
256
-
257
- ### 2026-10-29 row reuse and patch cost A/B (historical, not re-run)
258
-
259
- The baseline is that round's saved f7a7ab8 production package. One session per scenario, 3 warmups and 15 measurements. The production Worker handler runs inside Node; responses are applied only after structuredClone. Worker timing excludes cross-thread transfer; the clone column is local copy time. equal is a fixed-length middle edit, shift alternately adds and removes characters and shifts later ranges, and rewrite changes every row.
260
-
261
- | Scenario | Worker median ms: before → after | Clone median ms: before → after | Patch apply ms: before → after | Response B: before → after | Shared nodes: before → after |
262
- | --- | --- | --- | --- | --- | --- |
263
- | list-equal | 64.51 → 58.51 | 17.78 → 0.12 | 29.29 → 3.73 | 1046617 → 14900 | 4 → 5998 |
264
- | list-shift | 63.60 → 82.15 | 19.81 → 0.46 | 28.21 → 4.71 | 1046667 → 38000 | 2 → 3002 |
265
- | table-equal | 38.87 → 31.14 | 13.18 → 0.10 | 16.88 → 2.14 | 591190 → 8565 | 4 → 3504 |
266
- | table-shift | 40.58 → 48.02 | 11.49 → 0.28 | 18.03 → 2.83 | 591237 → 20156 | 2 → 1759 |
267
- | dynamic-list-equal | 199.45 → 174.49 | 30.99 → 0.22 | 42.75 → 6.10 | 1396442 → 15432 | 5 → 7997 |
268
- | dynamic-list-shift | 196.83 → 201.79 | 27.69 → 0.51 | 44.03 → 9.47 | 1396492 → 38532 | 3 → 4003 |
269
- | dynamic-table-equal | 91.72 → 70.99 | 14.12 → 0.16 | 22.20 → 2.15 | 603521 → 8674 | 5 → 3505 |
270
- | dynamic-table-shift | 84.61 → 83.23 | 12.44 → 0.30 | 19.61 → 2.43 | 603570 → 20267 | 3 → 1760 |
271
- | paragraphs-equal | 7.98 → 8.36 | 0.10 → 0.10 | 1.23 → 1.14 | 11145 → 11184 | 1602 → 1602 |
272
- | list-rewrite | 73.39 → 97.10 | 18.77 → 21.86 | 28.70 → 0.00 | 1090461 → 905965 | 4 → 0 |
273
-
274
-
275
- In that round, equal-length single-row edits mainly reduced transfer, main-thread patch application and React node replacement. Shift edits must update later ranges and still clone objects; a whole-block rewrite encodes first and then decides to send a full result, so Worker encoding cost may rise. The real-browser measurements in the previous section cannot be replaced by Node handler data for end-to-end latency.
276
-
277
- ### Real Worker and end-to-end preview
278
-
279
- An independent module Worker per input, 2 warmups and 5 measurements. The table isolates React; round-trip includes source and result copying, scheduling and main-thread receipt.
280
-
281
- | Scenario | Worker median / P95 ms | Round-trip median / P95 ms | Result |
282
- | --- | --- | --- | --- |
283
- | article-100 | 28.90 / 39.40 | 31.40 / 43.20 | success |
284
- | article-600 | 140.80 / 165.50 | 159.50 / 182.30 | success |
285
- | controls-1000 | 100.80 / 117.50 | 107.30 / 122.60 | success |
286
- | controls-5000 | 383.70 / 613.30 | 415.60 / 638.60 | success |
287
- | controls-10000 | 804.30 / 871.20 | 870.50 / 925.80 | success |
288
- | paragraphs-5000 | 36.40 / 45.80 | 52.40 / 61.70 | success |
289
- | plain-1000000 | 9.00 / 12.50 | 12.80 / 17.80 | success |
290
- | markdown-depth-500 | no successful samples | no successful samples | RangeError |
291
- | markdown-depth-1000 | no successful samples | no successful samples | RangeError |
292
- | markdown-depth-2000 | 4.10 / 5.30 | 4.40 / 5.50 | local.budget.markdown-depth |
293
-
294
-
295
- Deep Markdown still has separate limits in the browser: the compilation results of the 500- and 1000-level cases trigger a RangeError (call-stack overflow) through native postMessage; 2000 levels is rejected by the depth budget and returns normally. A subsequent ordinary request on the same Worker recovers. A successful Node compilation does not mean the result graph can be cloned and rendered directly in the browser; the public scheduler negotiates `flat-v1` flat results.
296
-
297
- **2026-10-29 historical record:** the following comparison uses the same controlled input fixture, a real module Worker and the production React profiling preview, comparing f7a7ab8 with that round's build. 3 warmups and 15 measurements per scenario, with version order alternating for regular scenarios; the dynamic table was re-measured after a pause in before/after order, so time-of-day drift exists. It requires the saved baseline package and was not re-run this round. The fixture isolates compilation and preview; real CM6 typing is measured separately in the next section.
298
-
299
- | Scenario | Worker median / P95 ms: before → after | Input-to-frame opportunity ms: before → after | Response median B: before → after |
300
- | --- | --- | --- | --- |
301
- | context | 37.00 / 68.00 → 34.00 / 48.00 | 93.80 / 118.40 → 88.60 / 103.00 | 1428 → 1435 |
302
- | body | 13.00 / 25.00 → 10.00 / 27.00 | 59.70 / 74.70 → 58.40 / 74.40 | 1356 → 1414 |
303
- | paragraphs | 21.00 / 51.00 → 25.00 / 48.00 | 96.00 / 124.80 → 100.30 / 122.90 | 12929 → 12968 |
304
- | list | 80.00 / 113.00 → 71.00 / 109.00 | 238.00 / 271.30 → 136.40 / 187.00 | 1057284 → 14913 |
305
- | table | 46.00 / 65.00 → 31.00 / 52.00 | 134.80 / 173.30 → 89.20 / 115.50 | 599741 → 8584 |
306
- | Dynamic list | 262.00 / 336.00 → 259.00 / 421.00 | 469.30 / 573.80 → 326.60 / 507.60 | 1404760 → 15445 |
307
- | Dynamic table | 124.00 / 220.00 → 115.00 / 377.00 | 233.40 / 398.40 → 170.70 / 450.50 | 608116 → 8685 |
308
-
309
-
310
- ### 2026-10-29 CM6 full editor and rendering phases (historical, not re-run)
311
-
312
- That round used the then-current single CM6 editor, the shared author-analysis Worker, the real LocalPreview, a stateful session and native input in the middle. The CM6 editor and its benchmark fixtures have moved to the ReactiveMD-Editor repository. React phases are instrumented only in the benchmark build; the production library does not contain these hooks. Later positions shift as editing grows.
313
-
314
- | Scenario | Input-to-frame opportunity median / P95 ms | Input-to-dispatch ms | Worker round-trip ms | Receive and apply ms | Editor render ms | Preview render ms |
315
- | --- | --- | --- | --- | --- | --- | --- |
316
- | paragraphs800 | 107.60 / 191.50 | 23.00 | 51.80 | 6.00 | 8.60 | 6.40 |
317
- | paragraphs2400 | 464.50 / 575.90 | 28.40 | 293.50 | 27.80 | 45.70 | 40.70 |
318
- | table1000 | 429.20 / 510.50 | 23.50 | 331.10 | 4.00 | 17.00 | 14.20 |
319
- | controls1000 | 118.50 / 290.30 | 23.70 | 48.50 | 1.00 | 6.90 | 4.70 |
320
- | controls5000 | 760.50 / 962.20 | 52.40 | 418.70 | 7.20 | 60.40 | 50.20 |
321
-
322
-
323
- | Scenario | commitRoot ms | DOM mutation ms | Layout Effects ms | Styles ms | Layout ms | Paint ms | Preview article replacements |
324
- | --- | --- | --- | --- | --- | --- | --- | --- |
325
- | paragraphs800 | 17.80 | 1.30 | 2.30 | 4.08 | 6.84 | 4.10 | 0 |
326
- | paragraphs2400 | 78.50 | 4.50 | 12.20 | 17.14 | 17.38 | 8.30 | 0 |
327
- | table1000 | 36.40 | 4.40 | 3.20 | 3.22 | 26.81 | 5.87 | 0 |
328
- | controls1000 | 34.10 | 2.30 | 4.30 | 3.24 | 20.28 | 9.12 | 0 |
329
- | controls5000 | 177.70 | 18.50 | 47.40 | 33.13 | 66.03 | 36.71 | 0 |
330
-
331
-
332
- Each rendering scenario also checks body/control DOM and focus retention, parameter 13 preserved, author initial values reset, the final commit of fast edits and new-session reset. Long paragraphs additionally check that offscreen text is still findable natively and that printing restores the full layout.
333
-
334
- Real CM6 continuous typing, 3 warmups and 15 measurements; source DOM includes the toolbar and author panel.
335
-
336
- | Scenario | Characters | Input-to-frame opportunity median / P95 ms | Source DOM | Mounted lines / total lines | Cumulative Layout ms | Long tasks |
337
- | --- | --- | --- | --- | --- | --- | --- |
338
- | paragraphs800 | 101529 | 15.30 / 20.10 | 294 | 47 / 1601 | 230.48 | 0 |
339
- | paragraphs2400 | 306129 | 27.60 / 39.80 | 294 | 47 / 4801 | 423.58 | 16 |
340
- | table1000 | 17949 | 16.80 / 21.10 | 228 | 71 / 1004 | 366.18 | 0 |
341
-
342
-
343
- CM6 source row DOM grows with the viewport. The preview keeps the document DOM, and later ordinary paragraphs use content-visibility:auto; this is not whole-area virtualization of the preview. Huge lists, tables and complex visualizations can still bear whole-block DOM, layout and paint costs.
344
-
345
- ### Runtime, formula and visualization updates
346
-
347
- This group is a Vite development fixture, 5 warmups and 15 measurements; it separates runtime.set, three-curve sampling, React updates, forced layout and local dependency scope, and cannot be compared directly with the production React profiling numbers above.
348
-
349
- | Phase | Median ms | P95 ms |
350
- | --- | --- | --- |
351
- | compile:interactive-article | 22.1000 | 27.6000 |
352
- | update:runtime-set | 0.0008 | 0.0021 |
353
- | plot:3-curves-200-samples | 0.2850 | 0.4600 |
354
- | render:final | 7.5000 | 22.7000 |
355
- | interaction:update-plot-render | 11.2000 | 14.2000 |
356
- | locality:100-sections | 8.3000 | 25.8000 |
357
- | locality:1-section | 4.3000 | 5.9000 |
358
- | locality:unreferenced | 9.7000 | 11.9000 |
359
- | visuals:10-tables | 9.2000 | 20.6000 |
360
- | visuals:1-table | 4.4000 | 6.9000 |
361
- | visuals:unreferenced | 3.7000 | 5.6000 |
362
- | charts:4-charts | 8.6000 | 13.7000 |
363
- | charts:1-chart | 5.1000 | 6.6000 |
364
- | charts:unreferenced | 3.2000 | 4.2000 |
365
-
366
-
367
- ### Sustained-edit memory, budgets and protocol recovery
368
-
369
- Node uses independent child processes and performs an explicit GC before each snapshot. The previous version's preview stays alive until the replacement result completes; the heap is measured after results and sessions are released.
370
-
371
- | Scenario | Count / scale | Retained heap after GC MiB | After releasing session MiB | Steady-state heap growth MiB |
372
- | --- | --- | --- | --- | --- |
373
- | longEdit | 500 | 25.615 | 17.316 | 0.302 |
374
- | longRows | 500 | 24.663 | 13.721 | 0.175 |
375
- | cacheEviction | 260 | 25.710 | 19.179 | n/a |
376
- | rapidCancel | 120 | 24.262 | 15.328 | n/a |
377
- | longText | 1000000 | 13.756 | 13.741 | n/a |
378
- | manyComponents | 5000 controls / 352779 characters | 29.973 | 15.056 | n/a |
379
- | deepContainers | 1000/1001 levels | n/a | 13.029 | n/a |
380
-
381
-
382
- **2026-10-29 historical record:** CM6 main-thread heap, with the probe array cleared and GC through CDP while host compilation state stays mounted; Worker heap not measured. This data depends on the split editor repository and was not re-measured this round:
383
-
384
- | Checkpoint | Heap after GC MiB | Source DOM |
385
- | --- | --- | --- |
386
- | edit-50 | 13.14 | 74 |
387
- | edit-2000 | 14.47 | 74 |
388
- | editor-unmounted-host-retained | 13.31 | 0 |
389
-
390
-
391
- The protocol re-measurement passed the old Worker, out-of-order responses, a stale baseline, corrupted patches, option switching, cancelled preparation and consecutive concurrent commits; page errors were empty. The stale baseline and corrupted patch each recover with one full request; cost selection returns a full success result directly rather than retrying after a failure. The public LocalReactiveDocument commits the correct document after a pausable, interruptible React transition and preserves input values; both the interrupted and final commits kept the value 13. The 2026-10-29 round additionally edited one row in huge static and dynamic lists and tables in a real browser; the preview DOM of unchanged rows kept the same object and the input value stayed 13.
392
-
393
- ### Current limits and where to optimize next
394
-
395
- - In the public snapshot path for 5000 ordinary short paragraphs, a session edit takes 81.39 ms, slower than full compilation at 70.04 ms. Sharing and full snapshot publishing still cost the whole tree; the public snapshot and the Worker's private sharing path should be optimized separately.
396
- - The 2026-10-29 full matrix showed tail regressions for dynamic tables and lists, and that round's browser comparison improved median and P95. In this re-measurement, list shift edits are still slower than equal-length edits; continue tracking how allocation and GC affect the tail.
397
- - Simple dynamic interpolation rows are on the fast path. Dynamic blocks containing links, escapes or complex inline formatting can still fall back; the next step can study local updates to row-fragment parsing and semantic summaries, continuing to validate with full-result diffs.
398
- - Shift edits in large lists and tables relocate many ranges; patch encoding and cost estimation for whole-block rewrites can still increase Worker time, so reduce duplicate traversal before encoding first. In this re-measurement, rejecting a 50000-item over-budget list took about 349 ms, so the traversal before rejection is worth analyzing.
399
- - CM6 still synchronizes with the host through a full source string, and author analysis also produces a whole result; long single lines, very long strings and large dependency graphs still involve linear work.
400
- - The preview is suited to further row-level and block-level subscriptions and to viewport-deferred visualization. Before truly unmounting offscreen preview, state, anchors, native find, cross-block selection and printing must be preserved.
401
- - Default depth budgets remain Markdown 1000 levels and components 100 levels. Deep results transfer after negotiating `flat-v1` through the public scheduler; custom Workers that hand deep `compileLocal()` results directly to native `postMessage()` are still limited by the browser call stack. Deep results currently send a complete flat snapshot each time; subtree patches can be studied later. Physical Chinese IME, mobile keyboards and assistive technology need manual acceptance on target devices.
402
-
403
- ### Reproduce and verify
404
-
405
- Full serial matrix (stages runnable in this repository):
406
-
407
- ```powershell
408
- npm run build
409
- node scripts/benchmark-performance-overview.mjs --skip=render,cm6
410
- # Add a comparison when a saved old production package exists:
411
- node scripts/benchmark-performance-overview.mjs --skip=render,cm6 --baseline=artifacts/next-editing/before-library
412
- # Re-measure by phase; do not run other performance processes at the same time:
413
- node scripts/benchmark-performance-overview.mjs --only=compiler,blocks,parser,fast,incremental,memory,rows,worker,protocol,stages
414
- ```
415
-
416
- This round covers compilation stress, 24 block types, mixed parsing, context recovery, snapshot copying, row reuse, Node and browser memory, Worker transfer, protocol recovery, runtime stages, table/chart dependency locality and plot sampling. Native CM6 input, React rendering phases and the f7a7ab8 baseline comparison depend on the split demo/editor repositories or a baseline package that was not retained, so they were not included.
417
-
418
- Functional gates passed by the 2026-10-29 `4a8f1ea` matrix: production build, type checking, standalone and declaration generation, public package boundaries and offline packed consumption; 1504 tests in 112 core test files and 254 tests in 16 Demo files; 8 browser checks of the unified editor, plus CM6, real workbench, author tools, images, diagnostics, document save/export and long-document preview regressions.
419
-
420
- The 2026-10-29 rendering semantic diff completed 350 steps of state, selection, reset, language and Tab operations with an identical final state; the optimized and baseline normalized markup are both 45806 characters and byte-identical, and page and console errors are empty. This round ran `npm run build` (type checking, production/standalone/declaration builds) successfully but did not re-run the full test gates.
421
-
422
- This round's per-sample JSON is in `artifacts/performance-overview-run2/`; it is a locally ignored artifact. The committable condensed summary is `benchmarks/performance-overview-2026-11-20.json`, which retains the measurement basis, code provenance and package hashes. The 2026-10-29 round's per-sample artifacts are in `artifacts/performance-overview/`, `artifacts/render-pipeline/` and `artifacts/cm6/`, with summaries in `benchmarks/performance-overview-2026-10-29.json` and `benchmarks/dynamic-depth-2026-10-29.json`. The original historical reports can be read from the corresponding Git commits.
1
+ # Performance optimization and current measurement overview
2
+
3
+ **English** · [中文](performance-overview-ch.md)
4
+
5
+ Re-tested 2026-11-20. Part 1 preserves each round's original record. Part 2's compilation, long-document editing, mixed parsing, incremental sessions, Worker, runtime stages and memory tables were re-measured on the 0.8.0 codebase at commit `8b0ccdc`; the full matrix was run twice on the same machine and the tables use the second pass. The editor and demo now live in separate repositories, so the CM6 full-editor, React rendering and targeted A/B comparisons cannot be re-run here; their 2026-10-29 records are retained and marked.
6
+
7
+ ## 1. Direction and outcome of each optimization round
8
+
9
+ The records below are as of each optimization. Cold compilation, steady-state editing and input-to-frame opportunity use different bases, so these numbers cannot be chained into a single speedup ratio. The current full matrix and the 2026-10-29 targeted re-measurements are in part two.
10
+
11
+
12
+ | Commit | Direction | Optimization outcome at the time and basis |
13
+ | --- | --- | --- |
14
+ | ea80662 | Ordinary paragraphs produce a LocalNode directly; Markdown without replacements reuses the first-pass AST, avoiding duplicate parsing and per-character mapping | Relative to df59896, first compilation of 5000 ordinary paragraphs 517.4 → 87.0 ms; 100k paragraphs rejected under the default budget 16339.7 → 29.9 ms, peak RSS 1003.8 → 69.4 MiB; after raising the budget to 250k nodes, successful compilation 19918.7 → 2297.8 ms. All are first calls in an independent Node process. |
15
+ | 6ac6916 | Added a block-level incremental session that locates changes with Lezer TreeFragment and keeps unmodified blocks; wired into the Worker, fallback compilation and React component | Full and incremental measured as pairs in the same build, 3 warmups and 15 measurements. A 600-section article 1030.09 → 30.65 ms, compiling only 1 block and reusing 1799; 5000 ordinary paragraphs 60.20 → 15.99 ms. Establishing a session for the first time has additional cost. |
16
+ | fb05509 | Deferred block-cache rebuilds during consecutive component-context changes; fast scanning for simple lists and tables; fewer copies of private results | Compared against the production package saved before the change. 100-item list session edit 15.08 → 5.70 ms, 200×4 table 30.78 → 10.82 ms (21 measurements); of 200 consecutive context changes the last 199 build no index, and restoring the body builds one. |
17
+ | 658a3b6 | Contiguous range mapping and shared row index; per-block fast/general dispatch; direct node production and upfront budgets; parse and semantic caches; shared results, bidirectional Worker patches, runtime reuse and cancellable idle preparation | Relative to fb05509, inside a container a 256k-indented long line 9846.93 → 25.09 ms, 80 mixed blocks 82.21 → 39.61 ms. Browser component-context Worker 80 → 60 ms, body 29 → 11 ms. The dynamic list preview regressed once from 394.3 to 503.5 ms; patches for huge lists and tables are still close to full results. |
18
+ | 047b547 | 20 ms Demo debounce; retained preview and runtime, stable highlighting and reference keys; later top-level paragraphs use content-visibility:auto | Relative to the production package and Demo snapshot saved before that round's change, the old full editor's input-to-frame opportunity: 800 dynamic paragraphs 705.5 → 182.5 ms; 2400 paragraphs 2401.9 → 644.6 ms; 1000-row dynamic table 837.1 → 446.3 ms (median, 15 samples). The baseline already includes earlier optimizations and is not the original fb05509. |
19
+ | f7a7ab8 | Introduced CM6 and made it the Demo default; source creates DOM per viewport; shared Worker author analysis; fixed const/computed and HTML syntax highlighting, restored the old color scheme | Two editors on the same prototype package: 800 paragraphs input-to-frame opportunity 93.7 → 15.0 ms, source DOM 4015 → 294; 2400 paragraphs 301.7 → 24.0 ms, DOM 12015 → 294; 1000-row dynamic table 223.8 → 16.5 ms. These are prototype records; this round re-measured through the single CM6 entry point. |
20
+ | 4a8f1ea | The previous-block row plan avoids the 512-entry LRU order scan on eviction; keeps unmodified row IDs and objects, updating ranges on shifts; sends a full success result instead of an unprofitable patch; copies short strings in caches; removed the old textarea source editor | A/B, real preview DOM, cache memory and the CM6 full matrix are below. /editor and /editor/codemirror share components, styles and runtime; the old textareaRef/getTextarea are removed, and the document form textarea remains supported. |
21
+ | This round (based on 4a8f1ea) | Simple dynamic rows reuse the validated placeholder plan, and the first-pass masking scan also skips Markdown inside expressions; deep node traversal, snapshot publishing, dependency summaries, runtime and view indexing use explicit stacks; negotiated flat result transfer; deep single-child container chains use fewer React memo wrappers | Compilation and preview comparisons for dynamic lists and tables are in the targeted re-measurement. Real Edge passed compilation and transfer of 1000-level references, lists and mixed nesting, and deep preview edits preserve parameter 13; 1001-level Markdown is rejected by budget. |
22
+
23
+
24
+ This round also confirmed a cache retention problem: short row strings could indirectly reference the old full text. Before the fix, for the same 1000-item list, the post-GC heap grew from 23.52 to 27.54 MiB between edits 100 and 200; after copying cache keys and inline token text, an independent re-measurement gave 20.26 → 20.34 MiB. A formal 500-edit long-row measurement follows below.
25
+
26
+ The historical implementation basis includes Lezer's incremental fragments, GFM container rules and CM6 viewport management; these approaches fall back conservatively according to current semantics. Reference definitions, footnotes, HTML, BOM, declaration or container context changes and code delimiter changes can still trigger a full compilation. This round brings simple dynamic interpolation rows into the fast path; links, escapes, nesting and complex inline formatting continue to fall back per block.
27
+
28
+ ## 2. Current compilation and rendering performance overview
29
+
30
+ ### Measurement conditions and coverage
31
+
32
+ Node v22.17.0, Intel(R) Core(TM) Ultra 5 125H, Windows x64. Node stress scenarios use independent processes with a 1 GiB old-generation cap; the browser is Edge 135.0.3179.66 in headless mode at a 1440×1000 viewport. Daily development processes remain running on the machine; power policy and CPU frequency were not pinned. Performance scripts run serially. This round was re-run on 2026-11-20 on the same machine; two full matrices were run back to back and several scenarios varied in both directions, so the tables use the second pass and its per-sample data is in the summary. Stages that depend on the demo or editor repositories were not included.
33
+
34
+ Typically 3 warmups and 15 measurements; the long-line and dedicated over-budget cases use 5/3, and the independent browser Worker uses 2 warmups and 5 measurements; the summary data is authoritative. P95 uses the nearest rank, which equals the maximum sample at 15 samples and is used only to observe the tail. First calls, public snapshot copies, shared Worker results and main-thread rendering are recorded separately.
35
+
36
+ RSS is the process high-water mark and includes Node, modules, input and temporary objects; the post-GC heap is the retained amount, and the two are not interchangeable. JSON UTF-8 message size is an estimate; structured-clone cost is measured separately. Input-to-preview ends at the second requestAnimationFrame frame opportunity after commit; CDP Paint is a paint-phase event, and neither indicates GPU display completion. React phases overlap and cannot be summed.
37
+
38
+ ### Targeted re-measurement from 2026-10-29: dynamic rows and deep nesting (historical, not re-run)
39
+
40
+ The baseline is the `4a8f1ea` production package saved at the start of that round, and post-change data comes from that round's final build; code hashes and condensed results are in `benchmarks/dynamic-depth-2026-10-29.json`. That round re-measured dynamic lists, dynamic tables, deep containers, protocol recovery and sustained-edit memory. The original record is kept here; current measurements are in the tables below.
41
+
42
+ Each browser group uses 3 warmups and 15 measurements. Before-change samples are retained from that round's first paired measurement, and after-change samples were re-measured on the final build. The table shows median/P95 in ms. Input is driven by an independent textarea fixture to compare the Worker-to-React preview path; CM6 and deep preview get separate real-browser functional verification.
43
+
44
+ | Dynamic scenario | Worker compile, before → after | Input to preview frame opportunity, before → after | Median response size, before → after |
45
+ | --- | --- | --- | --- |
46
+ | 1000-item dynamic list | 268/342 → 175/253 | 339.6/408.9 → 280.6/396.7 | 15444 → 15453 B |
47
+ | 500-row dynamic table | 213/310 → 66/89 | 286/373.1 → 134.4/159.1 | 8688 → 8693 B |
48
+
49
+ Node in-process Worker-handler comparisons also use 3 warmups and 15 measurements; the table below lists only the compilation phase and excludes patch encoding, cloning or React.
50
+
51
+ | Scenario | Compile median/P95, before → after ms |
52
+ | --- | --- |
53
+ | 1000-item dynamic list, equal-length edit | 148/212 → 104/129 |
54
+ | 1000-item dynamic list, shift edit | 195/291 → 266/368 |
55
+ | 500-row dynamic table, equal-length edit | 111/202 → 86/106 |
56
+ | 500-row dynamic table, shift edit | 115/230 → 110/185 |
57
+
58
+ This batch's Node shift list regressed; a separate new-process comparison gave 324/508 → 124/255 ms. Both batches show clear jitter, so all raw results are kept and that round computes no unified speedup ratio. The browser table uses final-build measurements.
59
+
60
+ Deep Node comparisons use independent processes, 1 warmup and 3 measurements, through the public `compileLocal()` path. The component limit remains 100 levels and the Markdown limit 1000 levels; over-limit rows record rejection time.
61
+
62
+ | Scenario and result | Compile median, before → after ms | First-call peak RSS, before → after MiB |
63
+ | --- | --- | --- |
64
+ | containers-50, success | 37.38 → 16.87 | 71.28 → 67.26 |
65
+ | containers-100, success | 109.42 → 32.91 | 81.17 → 70.29 |
66
+ | containers-101, local.budget.nesting | 107.89 → 11.14 | 79.43 → 67.12 |
67
+ | containers-1000, local.budget.nesting | 4587.18 → 88.83 | 138.18 → 97.64 |
68
+ | markdown-depth-500, success | 10.25 → 12.37 | 67.17 → 67.19 |
69
+ | markdown-depth-1000, success | 22.29 → 20.08 | 77.91 → 76.86 |
70
+ | markdown-depth-1500, local.budget.markdown-depth | 3.19 → 2.8 | 64.17 → 64.04 |
71
+
72
+ 500-level blockquotes are slightly slower in this batch of Node measurements; the main gain of the deep work is fewer duplicate parses of component bodies, earlier termination of over-limit input, and removal of browser call-stack and result-transfer failures. A 1000-level list still takes hundreds of milliseconds, and general container parsing still has room for improvement.
73
+
74
+ The real Edge module Worker passed 100/500/1000-level blockquotes, 1000-level lists and 500 groups of mixed reference/list nesting, and leaf expressions were correct after deep edits. A corrupted flat frame recovers with exactly one full request, after which a 1001-level budget rejection and an ordinary document return to normal. CM6 and the React preview passed 500/1000-level references, 1000-level unordered/ordered lists and mixed nesting; the original DOM depth is preserved, the expression edited from `n * 2` to `n * 3` displays 39, the parameter stays 13, only one Worker is created, and page and console errors are empty.
75
+
76
+ The implementation includes three constraints: the fast plan validates placeholder positions and types produced by the current parse every time, and the first-pass expression masking plan only supplies Markdown facts and must not generate body nodes; deep results negotiate `flatResults: "flat-v1"` into flat records plus references, while ordinary documents keep the existing patches; single-child Markdown container chains above 32 levels build native wrappers iteratively, reducing React memo component layers while preserving native DOM structure. Copying, sharing, flat encoding/decoding, runtime indexing and view projection of 6000-level data have separate unit verification.
77
+
78
+ A 1000-item dynamic list edited 500 times consecutively: post-GC heap growth over edits 50–500 is 0.463 MiB, retained heap 18.146 MiB, and 13.095 MiB after releasing the session; the parse cache ends at 524 entries, still within the 672-entry cap.
79
+
80
+ The implementation references [Lezer's context and incremental reuse constraints](https://lezer.codemirror.net/docs/guide/) and [V8's iterative traversal approach](https://v8.dev/blog/json-stringify). Flat records reference [the object index table of @ungap/structured-clone](https://github.com/ungap/structured-clone/blob/main/esm/serialize.js); that implementation's visitor is still recursive, whereas this round implements iterative traversal for the compiler's ordinary data with no new dependency.
81
+
82
+ That round's gates: 116 core test files with 1534 tests and 16 Demo files with 254 tests pass; type checking, production/standalone/declaration builds, Demo builds, public package checks and offline packed consumption pass; documentation links and `git diff --check` pass. The deep stress unit tests set a separate 30-second timeout, and performance statistics come from production-package scripts.
83
+
84
+ Reproduce the targeted tests (the commands below belong to that round; the CM6 fixture used by `--preview` moved to the editor repository):
85
+
86
+ ```powershell
87
+ npm run build
88
+ node scripts/benchmark-row-reuse.mjs --case=dynamic --out=artifacts/dynamic-depth/rows-after-final.json
89
+ node scripts/verify-deep-worker-browser.mjs --preview
90
+ $env:EDITING_BEFORE="artifacts/dynamic-depth/before-library"
91
+ $env:EDITING_DYNAMIC_ROWS="1"
92
+ $env:EDITING_CASES="list,table"
93
+ node scripts/benchmark-editing-comparison.mjs
94
+ $env:EDITING_MEMORY_CASES="longRows"
95
+ $env:EDITING_MEMORY_REPORT="artifacts/dynamic-depth/dynamic-memory.json"
96
+ node scripts/benchmark-editing-memory.mjs
97
+ ```
98
+
99
+ Per-sample results and failure reproductions are kept in `artifacts/dynamic-depth/`. The old-package snapshot is a local artifact; re-running the comparison requires saving an identical baseline production package first.
100
+
101
+ ### Full compilation and extreme input (8b0ccdc, 45 scenarios)
102
+
103
+ Calls the public compileLocal; timing includes final result construction and excludes input generation, checking and GC. The node budget defaults to 10000; scenarios marked raised use 250000. Character counts are UTF-16 code units. Budget rejections are listed separately as expected outcomes, and all scenarios should exit normally.
104
+
105
+
106
+ | Scenario ID | Characters | Result / nodes | First ms | Steady-state median / P95 ms | First-call peak RSS MiB |
107
+ | --- | --- | --- | --- | --- | --- |
108
+ | plain-10000 | 10000 | success / 2 | 12.14 | 0.17 / 0.83 | 67.89 |
109
+ | plain-100000 | 100000 | success / 2 | 18.77 | 0.62 / 1.32 | 69.16 |
110
+ | plain-500000 | 500000 | success / 2 | 22.23 | 3.73 / 6.79 | 70.13 |
111
+ | plain-1000000 | 1000000 | success / 2 | 21.02 | 5.36 / 6.59 | 71.16 |
112
+ | plain-1000001 | 1000001 | local.budget.document | 9.21 | 0.05 / 0.21 | 69.45 |
113
+ | article-10 | 1598 | success / 161 | 61.92 | 6.33 / 11.67 | 73.51 |
114
+ | article-100 | 15550 | success / 1601 | 125.82 | 28.62 / 42.80 | 83.66 |
115
+ | article-600 | 94050 | success / 9601 | 450.76 | 339.55 / 406.06 | 125.39 |
116
+ | article-2000 | 315852 | local.budget.nodes | 738.17 | 518.00 / 829.54 | 160.56 |
117
+ | article-2000-raised | 315852 | success / 32001 | 1147.08 | 838.71 / 1054.24 | 177.64 |
118
+ | controls-1000 | 68779 | success / 1000 | 264.14 | 136.45 / 156.61 | 119.97 |
119
+ | controls-5000 | 352779 | success / 5000 | 921.47 | 831.04 / 905.37 | 206.09 |
120
+ | controls-10000 | 707779 | success / 10000 | 1745.31 | 1477.54 / 1791.96 | 342.32 |
121
+ | controls-10001 | 707852 | local.budget.nodes | 197.23 | 149.45 / 173.64 | 115.06 |
122
+ | controls-12000 | 853779 | local.budget.nodes | 259.77 | 179.85 / 215.00 | 119.33 |
123
+ | controls-10000-raised | 707779 | success / 10000 | 1652.14 | 1502.26 / 1986.24 | 338.87 |
124
+ | controls-12000-raised | 853779 | success / 12000 | 2195.87 | 1897.38 / 2221.06 | 391.69 |
125
+ | shared-controls-5000 | 270000 | success / 5000 | 845.98 | 629.16 / 813.83 | 215.34 |
126
+ | conflicting-controls-5000 | 329999 | local.initial.duplicate-peers | 856.53 | 684.66 / 872.58 | 198.07 |
127
+ | expressions-1000 | 21960 | success / 4001 | 259.66 | 84.07 / 131.19 | 106.48 |
128
+ | expressions-5000 | 113960 | local.budget.nodes | 435.23 | 194.96 / 225.71 | 146.44 |
129
+ | expressions-5000-raised | 113960 | success / 20001 | 712.13 | 502.46 / 696.91 | 157.50 |
130
+ | paragraphs-1000 | 6000 | success / 2000 | 35.12 | 10.68 / 18.20 | 78.88 |
131
+ | paragraphs-5000 | 30000 | success / 10000 | 101.65 | 54.03 / 60.55 | 92.74 |
132
+ | paragraphs-10000 | 60000 | local.budget.nodes | 18.27 | 1.79 / 7.25 | 72.91 |
133
+ | paragraphs-20000 | 120000 | local.budget.nodes | 17.83 | 2.33 / 4.25 | 72.98 |
134
+ | paragraphs-100000 | 600000 | local.budget.nodes | 23.95 | 6.92 / 11.95 | 79.15 |
135
+ | paragraphs-100000-raised | 600000 | success / 200000 | 1839.39 | 2007.70 / 2364.49 | 291.53 |
136
+ | formatted-paragraphs-5000 | 285000 | local.budget.nodes | 609.26 | 507.34 / 594.79 | 176.37 |
137
+ | formatted-paragraphs-5000-raised | 285000 | success / 40000 | 1012.14 | 828.23 / 981.74 | 206.25 |
138
+ | containers-50 | 956 | success / 52 | 75.31 | 16.42 / 19.85 | 79.57 |
139
+ | containers-100 | 1906 | success / 102 | 106.02 | 33.63 / 40.69 | 82.22 |
140
+ | containers-101 | 1925 | local.budget.nesting | 57.15 | 11.00 / 20.12 | 77.44 |
141
+ | containers-1000 | 19006 | local.budget.nesting | 213.41 | 110.43 / 134.72 | 101.30 |
142
+ | unclosed-1000 | 9004 | local.budget.nesting | 130.10 | 63.69 / 81.02 | 82.53 |
143
+ | markdown-depth-100 | 204 | success / 102 | 35.97 | 3.03 / 5.84 | 70.54 |
144
+ | markdown-depth-500 | 1004 | success / 502 | 53.59 | 8.77 / 14.23 | 78.91 |
145
+ | markdown-depth-1000 | 2004 | success / 1002 | 80.30 | 19.77 / 31.34 | 86.86 |
146
+ | markdown-depth-1500 | 3004 | local.budget.markdown-depth | 25.95 | 1.89 / 5.13 | 72.34 |
147
+ | markdown-depth-2000 | 4004 | local.budget.markdown-depth | 30.74 | 2.49 / 4.45 | 73.88 |
148
+ | markdown-depth-5000 | 10004 | local.budget.markdown-depth | 49.46 | 4.97 / 7.78 | 82.66 |
149
+ | math-1000 | 16000 | success / 2000 | 406.93 | 194.00 / 218.00 | 121.20 |
150
+ | table-1000 | 28910 | success / 5008 | 196.79 | 60.20 / 80.78 | 96.14 |
151
+ | computed-chain-1000 | 45839 | success / 3 | 296.67 | 137.38 / 168.25 | 118.54 |
152
+ | computed-chain-5000 | 237839 | success / 3 | 902.24 | 625.79 / 751.97 | 208.96 |
153
+
154
+
155
+ ### Long-document editing across block types (24 scenarios)
156
+
157
+ The same target block sits among 1000 ordinary paragraphs; version numbers have fixed width, and the fenced-delimiter scenario actively changes the boundary. Independent process per scenario, alternating full compilation and session compilation order. The table includes the cost of publishing an independent public snapshot; syntax highlighting, plot sampling and DOM layout are outside this table.
158
+
159
+ | Target block | Single-block full ms | Long-document full ms | Session median / P95 ms | Final mode | Reused blocks |
160
+ | --- | --- | --- | --- | --- | --- |
161
+ | Ordinary paragraph, about 512 characters | 0.22 | 11.05 | 15.21 / 22.42 | incremental | 1000 |
162
+ | Ordinary paragraph, about 8 Ki characters | 0.24 | 9.90 | 15.94 / 21.03 | incremental | 1000 |
163
+ | Formatted paragraph, about 512 characters | 3.36 | 40.03 | 20.27 / 23.92 | incremental | 1000 |
164
+ | Level-2 heading, about 80 characters | 0.83 | 37.30 | 16.83 / 20.78 | incremental | 1000 |
165
+ | Unordered list, 20 items | 1.93 | 23.12 | 14.36 / 22.48 | incremental | 1000 |
166
+ | Unordered list, 100 items | 7.19 | 25.18 | 20.96 / 29.45 | incremental | 1000 |
167
+ | Ordered list, 20 items | 1.66 | 22.02 | 15.24 / 20.90 | incremental | 1000 |
168
+ | Markdown table, 20×4 | 2.43 | 22.43 | 15.41 / 20.44 | incremental | 1000 |
169
+ | Markdown table, 100×4 | 5.72 | 32.02 | 26.48 / 33.35 | incremental | 1000 |
170
+ | Markdown table, 200×4 | 15.04 | 37.64 | 33.75 / 63.07 | incremental | 1000 |
171
+ | Blockquote, 10 paragraphs | 2.12 | 33.93 | 14.74 / 22.42 | incremental | 1000 |
172
+ | Fenced code, 60 lines | 1.64 | 39.44 | 17.34 / 21.56 | incremental | 1000 |
173
+ | Fenced code, 300 lines | 3.47 | 41.13 | 18.93 / 23.55 | incremental | 1000 |
174
+ | Indented code, 60 lines | 1.58 | 93.63 | 20.17 / 41.95 | incremental | 1000 |
175
+ | Display formula, 20 items | 3.53 | 72.09 | 19.64 / 35.87 | incremental | 1000 |
176
+ | Display formula, 80 items | 8.07 | 72.58 | 24.87 / 42.12 | incremental | 1000 |
177
+ | Expression paragraph, 20 interpolations | 2.51 | 68.18 | 18.68 / 32.43 | incremental | 1000 |
178
+ | Slider initial value change | 1.73 | 79.63 | 91.34 / 144.33 | full | 0 |
179
+ | Panel interior, 50 paragraphs | 6.03 | 79.72 | 74.44 / 83.49 | full | 0 |
180
+ | ReactiveMD table, 20×4 | 4.87 | 77.61 | 96.41 / 127.31 | full | 0 |
181
+ | Bar chart data, 20 rows | 4.29 | 67.02 | 81.17 / 105.50 | full | 0 |
182
+ | Plot formula, 1 curve | 3.64 | 71.66 | 84.50 / 112.96 | full | 0 |
183
+ | Diagram node body, 20 nodes | 9.06 | 66.52 | 70.31 / 107.23 | full | 0 |
184
+ | Fenced delimiter change, 60 lines of code | 1.49 | 39.16 | 54.30 / 68.21 | full | 0 |
185
+
186
+
187
+ ### Fast/general mixed parsing and long lines
188
+
189
+ Covers simple blocks interleaved with links and escapes, native and component tables, dynamic cells, 5000 controls, very long indented lines inside containers, and large over-budget lists.
190
+
191
+ | Scenario | Median / P95 ms | Process peak RSS MiB |
192
+ | --- | --- | --- |
193
+ | ordinary-1000 | 12.81 / 19.20 | 108.34 |
194
+ | mixed-80 | 53.82 / 67.16 | 167.36 |
195
+ | table-1000 | 84.78 / 97.55 | 178.88 |
196
+ | component-table-500 | 41.29 / 64.94 | 163.93 |
197
+ | component-dynamic-table-500 | 35.70 / 40.62 | 119.51 |
198
+ | controls-5000 | 671.72 / 1066.59 | 548.40 |
199
+ | indented-line-16000 | 10.64 / 12.23 | 93.00 |
200
+ | indented-line-64000 | 21.97 / 31.13 | 91.98 |
201
+ | indented-line-256000 | 75.08 / 85.49 | 89.41 |
202
+ | over-budget-list-50000 | 349.35 / 352.36 | 532.13 |
203
+
204
+
205
+ Cache recovery of an independent body after 200 consecutive component-context changes:
206
+
207
+ | Context edit median / P95 ms | Index rebuilds during consecutive changes | Restore body ms | Index builds during restore |
208
+ | --- | --- | --- | --- |
209
+ | 52.80 / 93.53 | 0 | 124.58 | 1 |
210
+
211
+
212
+ Full compilation scale for pure blocks:
213
+
214
+ | Scenario | Median / P95 ms | Peak RSS MiB |
215
+ | --- | --- | --- |
216
+ | bullet-100 | 8.27 / 14.95 | 84.77 |
217
+ | bullet-500 | 26.40 / 31.44 | 133.75 |
218
+ | bullet-1500 | 90.62 / 124.96 | 191.04 |
219
+ | table-100 | 8.71 / 14.94 | 100.35 |
220
+ | table-500 | 39.94 / 49.41 | 142.10 |
221
+ | table-1000 | 89.38 / 133.26 | 195.25 |
222
+ | component-table-100 | 12.16 / 20.38 | 103.84 |
223
+ | component-table-500 | 46.24 / 61.33 | 145.66 |
224
+
225
+
226
+ Full compilation versus session editing in the same build, including full snapshot publishing:
227
+
228
+ | Document | Full median ms | Session median ms | First session ms | Compiled / reused blocks |
229
+ | --- | --- | --- | --- | --- |
230
+ | paragraphs-5000 | 70.04 | 81.39 | 365.93 | 1 / 4999 |
231
+ | formatted-paragraphs-1000 | 147.40 | 58.84 | 390.44 | 1 / 999 |
232
+ | article-600 | 213.85 | 74.87 | 609.83 | 1 / 1799 |
233
+ | article-2000 | 767.36 | 271.56 | 1196.28 | 1 / 5999 |
234
+
235
+
236
+ ### Row reuse and patch cost (8b0ccdc)
237
+
238
+ The current production package runs the production Worker handler inside Node, one session per scenario, 3 warmups and 15 measurements; responses are applied only after structuredClone. Worker timing excludes cross-thread transfer; the clone column is local copy time. equal is a fixed-length middle edit, shift alternately adds and removes characters and shifts later ranges, and rewrite changes every row.
239
+
240
+ | Scenario | Worker median ms | Compile median ms | Encode median ms | Clone median ms | Patch apply ms | Response B | Shared nodes |
241
+ | --- | --- | --- | --- | --- | --- | --- | --- |
242
+ | list-equal | 86.07 | 79.00 | 6.00 | 0.15 | 4.13 | 14900 | 5998 |
243
+ | list-shift | 116.62 | 110.00 | 5.00 | 0.49 | 5.71 | 38001 | 3002 |
244
+ | table-equal | 50.50 | 47.00 | 4.00 | 0.16 | 3.05 | 8565 | 3504 |
245
+ | table-shift | 68.20 | 59.00 | 9.00 | 0.45 | 3.45 | 20156 | 1759 |
246
+ | dynamic-list-equal | 167.81 | 157.00 | 10.00 | 0.27 | 6.39 | 15436 | 7997 |
247
+ | dynamic-list-shift | 204.73 | 197.00 | 10.00 | 0.69 | 7.92 | 38536 | 4003 |
248
+ | dynamic-table-equal | 60.61 | 57.00 | 4.00 | 0.19 | 2.68 | 8681 | 3505 |
249
+ | dynamic-table-shift | 66.12 | 63.00 | 3.00 | 0.36 | 3.01 | 20274 | 1760 |
250
+ | paragraphs-equal | 8.41 | 7.00 | 1.00 | 0.11 | 1.19 | 11184 | 1602 |
251
+ | list-rewrite | 127.97 | 104.00 | 28.00 | 21.97 | 0.00 | 906084 | 0 |
252
+
253
+ Equal-length single-row edits mainly reduce transfer, main-thread patch application and React node replacement. Shift edits must update later ranges and still clone objects; a whole-block rewrite encodes first and then decides to send a full result, so Worker encoding cost may rise. Real-browser end-to-end latency is in the next section; Node handler data cannot replace it.
254
+
255
+ The 2026-10-29 round ran the same comparison against a saved f7a7ab8 production package. That baseline is not retained in this repository, so it was not re-run this round; its results remain in `benchmarks/performance-overview-2026-10-29.json`.
256
+
257
+ ### 2026-10-29 row reuse and patch cost A/B (historical, not re-run)
258
+
259
+ The baseline is that round's saved f7a7ab8 production package. One session per scenario, 3 warmups and 15 measurements. The production Worker handler runs inside Node; responses are applied only after structuredClone. Worker timing excludes cross-thread transfer; the clone column is local copy time. equal is a fixed-length middle edit, shift alternately adds and removes characters and shifts later ranges, and rewrite changes every row.
260
+
261
+ | Scenario | Worker median ms: before → after | Clone median ms: before → after | Patch apply ms: before → after | Response B: before → after | Shared nodes: before → after |
262
+ | --- | --- | --- | --- | --- | --- |
263
+ | list-equal | 64.51 → 58.51 | 17.78 → 0.12 | 29.29 → 3.73 | 1046617 → 14900 | 4 → 5998 |
264
+ | list-shift | 63.60 → 82.15 | 19.81 → 0.46 | 28.21 → 4.71 | 1046667 → 38000 | 2 → 3002 |
265
+ | table-equal | 38.87 → 31.14 | 13.18 → 0.10 | 16.88 → 2.14 | 591190 → 8565 | 4 → 3504 |
266
+ | table-shift | 40.58 → 48.02 | 11.49 → 0.28 | 18.03 → 2.83 | 591237 → 20156 | 2 → 1759 |
267
+ | dynamic-list-equal | 199.45 → 174.49 | 30.99 → 0.22 | 42.75 → 6.10 | 1396442 → 15432 | 5 → 7997 |
268
+ | dynamic-list-shift | 196.83 → 201.79 | 27.69 → 0.51 | 44.03 → 9.47 | 1396492 → 38532 | 3 → 4003 |
269
+ | dynamic-table-equal | 91.72 → 70.99 | 14.12 → 0.16 | 22.20 → 2.15 | 603521 → 8674 | 5 → 3505 |
270
+ | dynamic-table-shift | 84.61 → 83.23 | 12.44 → 0.30 | 19.61 → 2.43 | 603570 → 20267 | 3 → 1760 |
271
+ | paragraphs-equal | 7.98 → 8.36 | 0.10 → 0.10 | 1.23 → 1.14 | 11145 → 11184 | 1602 → 1602 |
272
+ | list-rewrite | 73.39 → 97.10 | 18.77 → 21.86 | 28.70 → 0.00 | 1090461 → 905965 | 4 → 0 |
273
+
274
+
275
+ In that round, equal-length single-row edits mainly reduced transfer, main-thread patch application and React node replacement. Shift edits must update later ranges and still clone objects; a whole-block rewrite encodes first and then decides to send a full result, so Worker encoding cost may rise. The real-browser measurements in the previous section cannot be replaced by Node handler data for end-to-end latency.
276
+
277
+ ### Real Worker and end-to-end preview
278
+
279
+ An independent module Worker per input, 2 warmups and 5 measurements. The table isolates React; round-trip includes source and result copying, scheduling and main-thread receipt.
280
+
281
+ | Scenario | Worker median / P95 ms | Round-trip median / P95 ms | Result |
282
+ | --- | --- | --- | --- |
283
+ | article-100 | 28.90 / 39.40 | 31.40 / 43.20 | success |
284
+ | article-600 | 140.80 / 165.50 | 159.50 / 182.30 | success |
285
+ | controls-1000 | 100.80 / 117.50 | 107.30 / 122.60 | success |
286
+ | controls-5000 | 383.70 / 613.30 | 415.60 / 638.60 | success |
287
+ | controls-10000 | 804.30 / 871.20 | 870.50 / 925.80 | success |
288
+ | paragraphs-5000 | 36.40 / 45.80 | 52.40 / 61.70 | success |
289
+ | plain-1000000 | 9.00 / 12.50 | 12.80 / 17.80 | success |
290
+ | markdown-depth-500 | no successful samples | no successful samples | RangeError |
291
+ | markdown-depth-1000 | no successful samples | no successful samples | RangeError |
292
+ | markdown-depth-2000 | 4.10 / 5.30 | 4.40 / 5.50 | local.budget.markdown-depth |
293
+
294
+
295
+ Deep Markdown still has separate limits in the browser: the compilation results of the 500- and 1000-level cases trigger a RangeError (call-stack overflow) through native postMessage; 2000 levels is rejected by the depth budget and returns normally. A subsequent ordinary request on the same Worker recovers. A successful Node compilation does not mean the result graph can be cloned and rendered directly in the browser; the public scheduler negotiates `flat-v1` flat results.
296
+
297
+ **2026-10-29 historical record:** the following comparison uses the same controlled input fixture, a real module Worker and the production React profiling preview, comparing f7a7ab8 with that round's build. 3 warmups and 15 measurements per scenario, with version order alternating for regular scenarios; the dynamic table was re-measured after a pause in before/after order, so time-of-day drift exists. It requires the saved baseline package and was not re-run this round. The fixture isolates compilation and preview; real CM6 typing is measured separately in the next section.
298
+
299
+ | Scenario | Worker median / P95 ms: before → after | Input-to-frame opportunity ms: before → after | Response median B: before → after |
300
+ | --- | --- | --- | --- |
301
+ | context | 37.00 / 68.00 → 34.00 / 48.00 | 93.80 / 118.40 → 88.60 / 103.00 | 1428 → 1435 |
302
+ | body | 13.00 / 25.00 → 10.00 / 27.00 | 59.70 / 74.70 → 58.40 / 74.40 | 1356 → 1414 |
303
+ | paragraphs | 21.00 / 51.00 → 25.00 / 48.00 | 96.00 / 124.80 → 100.30 / 122.90 | 12929 → 12968 |
304
+ | list | 80.00 / 113.00 → 71.00 / 109.00 | 238.00 / 271.30 → 136.40 / 187.00 | 1057284 → 14913 |
305
+ | table | 46.00 / 65.00 → 31.00 / 52.00 | 134.80 / 173.30 → 89.20 / 115.50 | 599741 → 8584 |
306
+ | Dynamic list | 262.00 / 336.00 → 259.00 / 421.00 | 469.30 / 573.80 → 326.60 / 507.60 | 1404760 → 15445 |
307
+ | Dynamic table | 124.00 / 220.00 → 115.00 / 377.00 | 233.40 / 398.40 → 170.70 / 450.50 | 608116 → 8685 |
308
+
309
+
310
+ ### 2026-10-29 CM6 full editor and rendering phases (historical, not re-run)
311
+
312
+ That round used the then-current single CM6 editor, the shared author-analysis Worker, the real LocalPreview, a stateful session and native input in the middle. The CM6 editor and its benchmark fixtures have moved to the ReactiveMD-Editor repository. React phases are instrumented only in the benchmark build; the production library does not contain these hooks. Later positions shift as editing grows.
313
+
314
+ | Scenario | Input-to-frame opportunity median / P95 ms | Input-to-dispatch ms | Worker round-trip ms | Receive and apply ms | Editor render ms | Preview render ms |
315
+ | --- | --- | --- | --- | --- | --- | --- |
316
+ | paragraphs800 | 107.60 / 191.50 | 23.00 | 51.80 | 6.00 | 8.60 | 6.40 |
317
+ | paragraphs2400 | 464.50 / 575.90 | 28.40 | 293.50 | 27.80 | 45.70 | 40.70 |
318
+ | table1000 | 429.20 / 510.50 | 23.50 | 331.10 | 4.00 | 17.00 | 14.20 |
319
+ | controls1000 | 118.50 / 290.30 | 23.70 | 48.50 | 1.00 | 6.90 | 4.70 |
320
+ | controls5000 | 760.50 / 962.20 | 52.40 | 418.70 | 7.20 | 60.40 | 50.20 |
321
+
322
+
323
+ | Scenario | commitRoot ms | DOM mutation ms | Layout Effects ms | Styles ms | Layout ms | Paint ms | Preview article replacements |
324
+ | --- | --- | --- | --- | --- | --- | --- | --- |
325
+ | paragraphs800 | 17.80 | 1.30 | 2.30 | 4.08 | 6.84 | 4.10 | 0 |
326
+ | paragraphs2400 | 78.50 | 4.50 | 12.20 | 17.14 | 17.38 | 8.30 | 0 |
327
+ | table1000 | 36.40 | 4.40 | 3.20 | 3.22 | 26.81 | 5.87 | 0 |
328
+ | controls1000 | 34.10 | 2.30 | 4.30 | 3.24 | 20.28 | 9.12 | 0 |
329
+ | controls5000 | 177.70 | 18.50 | 47.40 | 33.13 | 66.03 | 36.71 | 0 |
330
+
331
+
332
+ Each rendering scenario also checks body/control DOM and focus retention, parameter 13 preserved, author initial values reset, the final commit of fast edits and new-session reset. Long paragraphs additionally check that offscreen text is still findable natively and that printing restores the full layout.
333
+
334
+ Real CM6 continuous typing, 3 warmups and 15 measurements; source DOM includes the toolbar and author panel.
335
+
336
+ | Scenario | Characters | Input-to-frame opportunity median / P95 ms | Source DOM | Mounted lines / total lines | Cumulative Layout ms | Long tasks |
337
+ | --- | --- | --- | --- | --- | --- | --- |
338
+ | paragraphs800 | 101529 | 15.30 / 20.10 | 294 | 47 / 1601 | 230.48 | 0 |
339
+ | paragraphs2400 | 306129 | 27.60 / 39.80 | 294 | 47 / 4801 | 423.58 | 16 |
340
+ | table1000 | 17949 | 16.80 / 21.10 | 228 | 71 / 1004 | 366.18 | 0 |
341
+
342
+
343
+ CM6 source row DOM grows with the viewport. The preview keeps the document DOM, and later ordinary paragraphs use content-visibility:auto; this is not whole-area virtualization of the preview. Huge lists, tables and complex visualizations can still bear whole-block DOM, layout and paint costs.
344
+
345
+ ### Runtime, formula and visualization updates
346
+
347
+ This group is a Vite development fixture, 5 warmups and 15 measurements; it separates runtime.set, three-curve sampling, React updates, forced layout and local dependency scope, and cannot be compared directly with the production React profiling numbers above.
348
+
349
+ | Phase | Median ms | P95 ms |
350
+ | --- | --- | --- |
351
+ | compile:interactive-article | 22.1000 | 27.6000 |
352
+ | update:runtime-set | 0.0008 | 0.0021 |
353
+ | plot:3-curves-200-samples | 0.2850 | 0.4600 |
354
+ | render:final | 7.5000 | 22.7000 |
355
+ | interaction:update-plot-render | 11.2000 | 14.2000 |
356
+ | locality:100-sections | 8.3000 | 25.8000 |
357
+ | locality:1-section | 4.3000 | 5.9000 |
358
+ | locality:unreferenced | 9.7000 | 11.9000 |
359
+ | visuals:10-tables | 9.2000 | 20.6000 |
360
+ | visuals:1-table | 4.4000 | 6.9000 |
361
+ | visuals:unreferenced | 3.7000 | 5.6000 |
362
+ | charts:4-charts | 8.6000 | 13.7000 |
363
+ | charts:1-chart | 5.1000 | 6.6000 |
364
+ | charts:unreferenced | 3.2000 | 4.2000 |
365
+
366
+
367
+ ### Sustained-edit memory, budgets and protocol recovery
368
+
369
+ Node uses independent child processes and performs an explicit GC before each snapshot. The previous version's preview stays alive until the replacement result completes; the heap is measured after results and sessions are released.
370
+
371
+ | Scenario | Count / scale | Retained heap after GC MiB | After releasing session MiB | Steady-state heap growth MiB |
372
+ | --- | --- | --- | --- | --- |
373
+ | longEdit | 500 | 25.615 | 17.316 | 0.302 |
374
+ | longRows | 500 | 24.663 | 13.721 | 0.175 |
375
+ | cacheEviction | 260 | 25.710 | 19.179 | n/a |
376
+ | rapidCancel | 120 | 24.262 | 15.328 | n/a |
377
+ | longText | 1000000 | 13.756 | 13.741 | n/a |
378
+ | manyComponents | 5000 controls / 352779 characters | 29.973 | 15.056 | n/a |
379
+ | deepContainers | 1000/1001 levels | n/a | 13.029 | n/a |
380
+
381
+
382
+ **2026-10-29 historical record:** CM6 main-thread heap, with the probe array cleared and GC through CDP while host compilation state stays mounted; Worker heap not measured. This data depends on the split editor repository and was not re-measured this round:
383
+
384
+ | Checkpoint | Heap after GC MiB | Source DOM |
385
+ | --- | --- | --- |
386
+ | edit-50 | 13.14 | 74 |
387
+ | edit-2000 | 14.47 | 74 |
388
+ | editor-unmounted-host-retained | 13.31 | 0 |
389
+
390
+
391
+ The protocol re-measurement passed the old Worker, out-of-order responses, a stale baseline, corrupted patches, option switching, cancelled preparation and consecutive concurrent commits; page errors were empty. The stale baseline and corrupted patch each recover with one full request; cost selection returns a full success result directly rather than retrying after a failure. The public LocalReactiveDocument commits the correct document after a pausable, interruptible React transition and preserves input values; both the interrupted and final commits kept the value 13. The 2026-10-29 round additionally edited one row in huge static and dynamic lists and tables in a real browser; the preview DOM of unchanged rows kept the same object and the input value stayed 13.
392
+
393
+ ### Current limits and where to optimize next
394
+
395
+ - In the public snapshot path for 5000 ordinary short paragraphs, a session edit takes 81.39 ms, slower than full compilation at 70.04 ms. Sharing and full snapshot publishing still cost the whole tree; the public snapshot and the Worker's private sharing path should be optimized separately.
396
+ - The 2026-10-29 full matrix showed tail regressions for dynamic tables and lists, and that round's browser comparison improved median and P95. In this re-measurement, list shift edits are still slower than equal-length edits; continue tracking how allocation and GC affect the tail.
397
+ - Simple dynamic interpolation rows are on the fast path. Dynamic blocks containing links, escapes or complex inline formatting can still fall back; the next step can study local updates to row-fragment parsing and semantic summaries, continuing to validate with full-result diffs.
398
+ - Shift edits in large lists and tables relocate many ranges; patch encoding and cost estimation for whole-block rewrites can still increase Worker time, so reduce duplicate traversal before encoding first. In this re-measurement, rejecting a 50000-item over-budget list took about 349 ms, so the traversal before rejection is worth analyzing.
399
+ - CM6 still synchronizes with the host through a full source string, and author analysis also produces a whole result; long single lines, very long strings and large dependency graphs still involve linear work.
400
+ - The preview is suited to further row-level and block-level subscriptions and to viewport-deferred visualization. Before truly unmounting offscreen preview, state, anchors, native find, cross-block selection and printing must be preserved.
401
+ - Default depth budgets remain Markdown 1000 levels and components 100 levels. Deep results transfer after negotiating `flat-v1` through the public scheduler; custom Workers that hand deep `compileLocal()` results directly to native `postMessage()` are still limited by the browser call stack. Deep results currently send a complete flat snapshot each time; subtree patches can be studied later. Physical Chinese IME, mobile keyboards and assistive technology need manual acceptance on target devices.
402
+
403
+ ### Reproduce and verify
404
+
405
+ Full serial matrix (stages runnable in this repository):
406
+
407
+ ```powershell
408
+ npm run build
409
+ node scripts/benchmark-performance-overview.mjs --skip=render,cm6
410
+ # Add a comparison when a saved old production package exists:
411
+ node scripts/benchmark-performance-overview.mjs --skip=render,cm6 --baseline=artifacts/next-editing/before-library
412
+ # Re-measure by phase; do not run other performance processes at the same time:
413
+ node scripts/benchmark-performance-overview.mjs --only=compiler,blocks,parser,fast,incremental,memory,rows,worker,protocol,stages
414
+ ```
415
+
416
+ This round covers compilation stress, 24 block types, mixed parsing, context recovery, snapshot copying, row reuse, Node and browser memory, Worker transfer, protocol recovery, runtime stages, table/chart dependency locality and plot sampling. Native CM6 input, React rendering phases and the f7a7ab8 baseline comparison depend on the split demo/editor repositories or a baseline package that was not retained, so they were not included.
417
+
418
+ Functional gates passed by the 2026-10-29 `4a8f1ea` matrix: production build, type checking, standalone and declaration generation, public package boundaries and offline packed consumption; 1504 tests in 112 core test files and 254 tests in 16 Demo files; 8 browser checks of the unified editor, plus CM6, real workbench, author tools, images, diagnostics, document save/export and long-document preview regressions.
419
+
420
+ The 2026-10-29 rendering semantic diff completed 350 steps of state, selection, reset, language and Tab operations with an identical final state; the optimized and baseline normalized markup are both 45806 characters and byte-identical, and page and console errors are empty. This round ran `npm run build` (type checking, production/standalone/declaration builds) successfully but did not re-run the full test gates.
421
+
422
+ This round's per-sample JSON is in `artifacts/performance-overview-run2/`; it is a locally ignored artifact. The committable condensed summary is `benchmarks/performance-overview-2026-11-20.json`, which retains the measurement basis, code provenance and package hashes. The 2026-10-29 round's per-sample artifacts are in `artifacts/performance-overview/`, `artifacts/render-pipeline/` and `artifacts/cm6/`, with summaries in `benchmarks/performance-overview-2026-10-29.json` and `benchmarks/dynamic-depth-2026-10-29.json`. The original historical reports can be read from the corresponding Git commits.