docs/plans/2026-04-10-api-drift-perf-benchmark-strategy.md
Stop arguing about API drift from architecture taste alone.
Next step: benchmark the meaningful API drifts first, then decide which ones deserve optimization work.
Execution register:
The repo already has the right pattern in place:
That should become the default workflow for all meaningful API drifts.
A drift deserves a perf lane when both are true:
Primary examples:
Editor.normalizeEditor.normalizeNodeEditor.shouldNormalizeEditor.withoutNormalizingThis class already has the best existing pattern:
Use it as the template for the rest.
Primary examples:
Editor.nodesEditor.positionsEditor.fragmentBenchmark only the rows that sit on hot user flows or are called in tight loops. Do not benchmark the entire namespace just because it exists.
Primary examples:
setNodesinsertFragmentmoveNodesThis class matters when public transform semantics are preserved but the new engine topology may have changed cost shape.
Important constraint:
slate-batch-engine behavior when usefulPrimary examples:
withReactEditableEditableBlocksuseSlateSelectoruseElementuseSelectedThis class should only be counted as API drift perf when the kept React/public surface itself is the hot seam, not when a lower-level core issue is the real culprit.
Build the benchmark inventory from:
For each kept drift row, record:
Every drift lane should have the same structure:
If a lane cannot answer the cause split, the lane is not ready to drive fixes.
Produce one register row per kept drift class, not per symbol unless a symbol is already known hot.
Normalization already has:
pnpm bench:normalization:localpnpm bench:normalization:compare:localMirror that pattern for the next API drift classes instead of inventing ad hoc one-off scripts.
For each red diagnostic lane, answer:
If it does not map upward, it stays diagnostic and should not hijack the whole optimization queue.
Only after a drift maps upward:
This is the point where optimization work becomes real.
Fix order:
Architecture guard:
One benchmark register for kept API drifts with these columns:
That register is the thing that should drive the next optimization strategy meeting, not another freehand debate about which drift “feels expensive.”