Skip to content

perf(client): speed up keyed updates and reactive traversal - #59

Merged
Marcisbee merged 7 commits into
masterfrom
kode/cSZShdLw-improve-radi-client-runtime-performance
Oct 22, 2026
Merged

Marcisbee merged 7 commits into
masterfrom
kode/cSZShdLw-improve-radi-client-runtime-performance

Conversation

@Marcisbee

@Marcisbee Marcisbee commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Radi repeatedly searched keyed arrays, used XPath unions to discover reactive descendants, and copied live child-node collections during reconciliation. Keyed searches now use a map/set; reactive discovery uses a TreeWalker snapshot; component discovery and child snapshots walk siblings; and single reactive-text updates avoid general reconciliation collections. Both child lists are still snapshotted before reconciliation. Moved-row render callbacks, DOM identity, native events, cleanup, and the public API remain unchanged.

The table playground also uses reactive label and selection bindings inside retained keyed rows. Previously its update button changed the data without changing displayed labels. Its regression test checks every row across repeated updates, DOM identity, and selection.

The final child-snapshot optimization was compared with preceding PR revision 428595e, using the unchanged PR #57 harness (6b6956a). Each workload used 10 measured samples after 3 warmups in Chromium 156. Two baseline runs and two candidate runs produced these ranges of median commit times:

Workload Previous PR, ms Final, ms
Reverse 1,000 rows 9.80–9.95 6.55–7.25
Remove the middle row 5.80 4.00–4.45
Create 10,000 rows 41.60–42.20 37.50–38.75
Unmount 1,000 rows 1.80 1.90–2.15

Not every workload improved. Other update timings varied between runs; unmount measured slightly slower in both candidate runs, without an isolated cause. Creation remains above the original pre-PR historical result of 36.10–36.70 ms. Preact and Vue remain faster on most operations. Earlier PR changes reduced replacement and cleanup costs; the original clear median was 8.15 ms. Historical comparisons across rounds are subject to run variation.

The final snapshot change adds 16 gzip bytes (4,996 → 5,012), or 167 bytes over the original runtime. Mounted post-GC JS heap remains approximately 10.46 MiB. The final full comparison includes all five frameworks; repeats isolate Radi using identical scenarios and correctness checks. Separate reverse-order profiling measures adapter bookkeeping outside runtime work: at 1,000 rows, median batch averages changed from 0.02 ms bookkeeping / 11.12 ms runtime to 0.03 / 7.27 ms. Raw samples, source hash, environment, and methodology accompany the task.

Validation: all 315 tests pass after incorporating current master, including its resumption additions. The 61 focused construction, root reconciliation, connection/update event, traversal, keyed-list, playground, and child-prop tests pass in Chromium, Firefox, and WebKit. Ten server-runtime tests and three release-tooling tests pass. Package generation, version check, and npm pack dry run pass. The refreshed real playground serves the current bundle and passes repeated every-tenth-row updates and selection. No API, compiler, component model, or release-version change is included.

@Marcisbee
Marcisbee marked this pull request as ready for review October 22, 2026 10:00
@Marcisbee
Marcisbee merged commit d5e4f75 into master Oct 22, 2026
2 checks passed
@Marcisbee
Marcisbee deleted the kode/cSZShdLw-improve-radi-client-runtime-performance branch October 22, 2026 12:51
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.

1 participant