Benchmarks
Generated by pnpm bench on 2026-11-24. Re-run it to reproduce; documents are generated from a fixed seed (scripts/bench-doc.mjs).
Environment#
- CPU: AMD Ryzen 7 5800H with Radeon Graphics (16 logical cores), 15 GB RAM
- OS: Windows_NT 10.0.26300 x64
- Node v24.22.1; Chromium 159.0.8154.6 (headless)
Documents#
Each document is a mix of paragraphs with formatted runs (70 %), list items (20 %), headings (~10 %) and a 3×3 table every 200 blocks.
| Blocks | JSON size | DOM elements |
|---|---|---|
| 1,000 | 248 kB | 7,273 |
| 5,000 | 1,226 kB | 19,495 |
| 20,000 | 4,892 kB | 65,289 |
Engine only (Node, no DOM)#
Milliseconds per operation, median / p95 where sampled.
| Blocks | Load + validate | Type a character | Split block | Move block | Undo step | Serialize JSON | Export HTML | Import that HTML |
|---|---|---|---|---|---|---|---|---|
| 1,000 | 10.3 | 0.02 / 0.057 | 0.02 / 0.069 | 0.024 / 0.05 | 0.025 | 2.6 | 3.1 | 33.8 |
| 5,000 | 22.5 | 0.015 / 0.031 | 0.046 / 0.081 | 0.048 / 0.07 | 0.061 | 11.9 | 6.6 | 110.3 |
| 20,000 | 81.9 | 0.013 / 0.028 | 0.196 / 0.243 | 0.209 / 0.264 | 0.181 | 47.4 | 36 | 361.8 |
In the browser (Chromium, headless)#
Two numbers per operation, each as median / p95 in milliseconds:
- handler — synchronous time of the input handler: model update, DOM patch, selection sync (includes any layout the browser is forced to do synchronously).
- to next frame — from dispatching the input until the next animation frame has run, i.e. including style, layout and paint. At 60 Hz the floor is ~16.7 ms.
| Blocks | Mount | Typing: handler | Typing: to next frame | Selection change: handler | to next frame | Move block: handler | to next frame | Paste 200 paragraphs (HTML): handler | to next frame |
|---|---|---|---|---|---|---|---|---|---|
| 1,000 | 25.5 | 0.9 / 1.2 | 16.5 / 18.6 | 1.2 / 2.3 | 16.8 / 18.7 | 1.9 / 2.8 | 16.8 / 18.6 | 25.5 / 135.6 | 44.7 / 155.5 |
| 5,000 | 70.2 | 3.1 / 6.4 | 16.9 / 30 | 4.3 / 6.1 | 22.3 / 32.6 | 6.8 / 9 | 17.8 / 28.1 | 20.8 / 109.5 | 80.9 / 145.3 |
| 20,000 | 279.2 | 14.8 / 38.2 | 64.4 / 135.8 | 16.3 / 22.1 | 103.9 / 146.4 | 35 / 80 | 108.1 / 294.8 | 40.1 / 399.2 | 261.4 / 561 |
Typing is dispatched as a real beforeinput event. Selection changes jump between blocks; moves relocate a top-level block; the paste goes through the HTML importer.
Reading the numbers#
- The editor's own work per keystroke is independent of document size (engine column: ~0.02 ms; with the view attached ~0.6 ms measured with
scripts/profile.mjsat 20,000 blocks). Only the touched block is re-rendered and its text node is updated in place. - What grows with size is the browser's layout of one very large flat document, which the selection API forces synchronously. Up to roughly 5,000 blocks (≈ a 300-page document) typing stays within a single frame; at 20,000 blocks it takes about three frames.
- Mitigations in place:
content-visibility: autoon top-level blocks above 400 blocks, caret measurements batched per frame, decorations painted with the Highlight API instead of DOM changes. - For very long documents use pages: in the default tabs view only the active page is laid out, so latency depends on the page, not the document.
- There is no virtualized rendering: every block of the visible page is in the DOM.
Bundle sizes#
Minified and gzipped, as an application bundler would ship them (esbuild, peer dependencies external). "Added" rows are the increase over the base editor.
| Import | Minified | Gzipped |
|---|---|---|
| headless core (createHeadlessEditor + serializers) | 142 kB | 46.1 kB |
| base editor with default UI (createEditor) | 294.3 kB | 95.7 kB |
| style.css | 48.8 kB | 9.3 kB |
| optional: code-highlight (added on top of base) | 6.2 kB | 2.5 kB |
| optional: react adapter (added on top of base, react external) | 2.3 kB | 0.9 kB |
| optional: vue adapter (added on top of base, vue external) | 2.6 kB | 1 kB |
| optional: collab (yjs + y-protocols external) | 14.3 kB | 6 kB |
| no-build file: zeditor.browser.js (editor + UI + highlighting) | 325.6 kB | 107 kB |
| no-build file: zeditor.collab.browser.js (includes Yjs) | 111.2 kB | 35.7 kB |
The base bundle has no runtime dependencies. React, Vue, Yjs and y-protocols are optional peer dependencies and are never bundled into the ESM entry points.