Skip to content

[stable35] perf(table): only check changed ranges for nested tables - #9577

Merged
blizzz merged 1 commit into
stable35from
backport/9576/stable35
Nov 13, 2026
Merged

blizzz merged 1 commit into
stable35from
backport/9576/stable35

Conversation

@backportbot

@backportbot backportbot Bot commented Nov 9, 2026

Copy link
Copy Markdown

Backport of PR #9576

The filter preventing nested tables walked the whole document on every
document change and resolved the position of every table, row and cell.
Resolving is linear in the number of siblings, so typing in a long table
got slower with every row.

A nested table can only appear in content changed by the transaction, so
only check the changed ranges, skip textblocks and only check table nodes:
rows, cells, headers and captions can only exist inside a table.

Benchmark on a 500 kB document with one table of 2,262 rows, median per
keystroke in a cell in the middle of the table, before -> after:

Chromium:
- typing:              795 ms -> 672 ms
- toggle bold (Ctrl+B): 797 ms -> 599 ms

Firefox:
- typing:              730 ms -> 487 ms
- toggle bold (Ctrl+B): 936 ms -> 319 ms

Related to #908

Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5-5
@blizzz
blizzz merged commit 0f2cdd3 into stable35 Nov 13, 2026
63 of 64 checks passed
@blizzz
blizzz deleted the backport/9576/stable35 branch November 13, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants