Skip to content

Add reorder1k benchmark#17

Merged
JoviDeCroock merged 3 commits into
mainfrom
reorder1k-bench
Jul 23, 2026
Merged

Add reorder1k benchmark#17
JoviDeCroock merged 3 commits into
mainfrom
reorder1k-bench

Conversation

@JoviDeCroock

Copy link
Copy Markdown
Member

What

Adds a reorder1k benchmark to the table-app suite: it renders 1,000 keyed rows, then measures moving the first 3 rows to the end of the list (3 warmup runs + 1 measured run, asserting row order between runs).

Why

This displacement pattern is a worst case for reconciliation heuristics that only recognize shift patterns: instead of moving the 3 displaced rows, the reconciler moves the entire 997-row suffix. None of the existing benchmarks exercise it — swapRows is excluded from the pathological path by design, and many-updates/update10th1k don't reorder at all.

It directly motivates preactjs/preact#5172 and the v11 minimal-moves work; current numbers on v10.x (Chrome 150, headless, tachometer):

variant median
preact 10.29.7 31.7 ms
preactjs/preact#5172 7.7 ms
v11 LIS branch 8.3 ms

How

  • store.displace(n) added to the shared table-app store
  • exposed as displace from the preact, preact-class, and preact-hooks implementations (preact-signals is currently a counter stub, so it was left alone)
  • apps/table-app/reorder1k.html modeled after update10th1k.html

Measures moving the first 3 of 1,000 keyed rows to the end of the list
(3 warmup runs plus a measured run). This displacement pattern is the
worst case for reconciliation heuristics that only handle shifts: the
whole suffix gets moved instead of the short displaced prefix.

Adds a displace(n) mutation to the shared store and exposes it from the
preact, preact-class, and preact-hooks table-app implementations.
The lockfile pins whatever chromedriver major was current when it was
last refreshed (131 right now), while the CI runner image ships a newer
Chrome (150). detect_chromedriver_version makes the chromedriver package
download the driver matching the installed browser, so the two can no
longer drift apart.
@JoviDeCroock
JoviDeCroock merged commit ec93e1b into main Jul 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants