docs/solutions/performance-issues/2026-04-11-slate-v2-huge-document-typing-needs-selector-fanout-cuts-before-islands.md
Huge-document typing was still losing hard to legacy chunking even after the core transaction fast path landed.
That made it tempting to jump straight to semantic islands or active-corridor work. That would have been premature.
5000-block browser compare still showed v2 typing around 71ms while
legacy chunking sat around 18msEditableTextBlocks and EditableText were stacking many independent
selector subscriptions across the same runtime ids and pathsCut the React runtime tax first in these files:
Kept changes:
EditableTextSecondary runtime cleanup:
slate-react source components with explicit createElement(...) usage so
Next dev can run the source package reliably during browser benchmarksMeasured results:
5000 blocks, current v2:
881.50ms -> 824.89ms71.18ms -> 65.45ms19.36ms -> 17.63ms96.68ms -> 93.44ms1000-block huge-document gate lane after the same batch:
470.20ms13.78ms2.74ms37.41ms-160.17ms, type -6.90ms, select-all
-71.49ms, paste -69.31msThe problem was not only “too many rerenders.” It was too many subscriptions and too much repeated selector work per committed snapshot.
Before the cut:
That meant a single committed edit still fanned out a lot of React-side work even when the engine was already cheap.
After the cut:
The runtime still loses to chunking on typing at scale, but it loses by less and for a cleaner reason.