Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Typing in a 5,000-row table took 26 seconds per key. Here’s how I got it to 24 ms.

Описание и применение

Оптимизация редактора Sarala позволила сократить задержку ввода в таблице из 5 000 строк с 26 с до 24 мс, устранив дорогостоящие операции с DOM и парсингом.

Задача

A single huge table block caused 26 s delay per keystroke in the Sarala editor.

Результат

Optimized Sarala’s handling of large blocks by eliminating DOM rebuilds and expensive parsing, reducing keystroke latency from 26 s to 24 ms for a 5,000‑row table.

Рабочий процесс

  • Benchmark large documents in browser
  • Profile keystroke latency
  • Identify DOM layout cost
  • Detect three bugs: table re‑measurement, quadratic token walk, per‑character slice
  • Replace block rendering with line‑by‑line editing
  • Use inline spans for layout
  • Add correctness tests for cursor behavior
  • Measure performance again
  • Publish results

Доказательства

A 5,000-row table took 26,028 ms per key

Источник

The big change: a very long block now edits as plain lines while it's active

Источник

My first profile didn't add up. Three keys took about 1.9 seconds, but JavaScript accounted for only around 500 ms.

Источник

  • Дата записи: 2026-11-02T21:14:12.582Z