Skip to content

KNT-0026: prototype component-scoped partial row rendering #10

Description

@IRus

Context

KNT-0026 is the component-scoped re-rendering idea: today a browser event dispatch invalidates the runtime and BrowserKineticaApp immediately performs a full root render. Memoized keyed each rows already know which cells they read, so the prototype tests whether a cell write can re-render only the affected keyed row and patch that mounted DOM subtree.

Prototype branch: https://github.com/Heapy/kinetica/tree/agent/knt-0026-partial-row-render
Commit: ef19383

This branch was created from latest origin/main at 9238046 and carries the prototype from the local knt-0026-prototype worktree.

Prototype shape

  • Registers partial render targets for memoized keyed each rows that emit exactly one keyed node.
  • Tracks target dependencies as ObservableCell -> partial target ids in KineticaRuntime.
  • On StateCellImpl writes, marks only dependent targets dirty when possible.
  • Browser production path consumes a partial render batch after event dispatch and patches matching mounted keyed nodes.
  • Falls back to full render for manual/global invalidation, missing targets, non-partial dependencies, debug mode, and unsafe patch targets.

Benchmark notes

10k benchmark, median:

operation baseline prototype delta
select10k 10.28 ms 7.37 ms -28.3%
create10k 291.79 ms 297.78 ms +2.1%
clear1k 6.66 ms 6.94 ms +4.2%
remove10k 68.31 ms 69.01 ms +1.0%
update10th10k 43.07 ms 46.45 ms +7.8%

100k direct select harness, median, 1 warmup + 5 samples:

operation baseline prototype delta
select100k direct 179.94 ms 66.67 ms -62.9%

100k direct update smoke, single sample:

operation baseline prototype delta
update100k direct 686.88 ms 657.63 ms -4.3%

The 100k direct harness builds 100k rows once and clicks a row through DOM child indexing to avoid Playwright selector overhead. It still exercises the real browser event path and render/patch/paint path, but it is not the exact official scaling driver.

Validation

  • ./kotlin task :kinetica-compiler:publishToMavenLocal
  • ./kotlin task :kinetica-browser:linkJsTest
  • ./kotlin task :kinetica-runtime:testJvm (208/208 tests passed)

Known gaps

  • Not PR-ready: this is a measurement prototype.
  • Partial browser path is disabled in debug mode.
  • currentTree / tree() can remain stale after a partial browser patch.
  • Mounted lookup is keyed-only, so key collisions across independent regions are not handled robustly.
  • Partial targets are limited to memoized keyed each rows with one keyed emitted node.
  • Registry maintenance adds overhead on create/update paths; the benefit is currently concentrated in row-local cell writes.

Next steps

  • Replace global keyed lookup with a frame/region-scoped mounted identity.
  • Decide how partial renders update the retained logical tree or make tree() semantics explicit.
  • Add browser tests for partial success and fallback behavior.
  • Add an official benchmark mode for 100k direct row interactions so this can be repeated without ad hoc harness code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions