Skip to content

Live holes: send and morph only the rows that changed #4064

Closed

Description

@ryansolid

Follow-up to #4056 (closed after #4057) and #4063.

Problem

A live hole that renders a list re-sends its whole markup whenever any row changes, and the client parses and morphs all of it. #4057 stopped the server from re-rendering unchanged rows during a sweep: a For row whose item is shallow-equal is reused. But the emission is still the whole hole. On the wire, streaming brotli absorbs most of the repetition, so bytes aren't the cost. The client cost is: the parse and morph of every unchanged row, plus layout over the whole range.

The server DBmon example (one live hole holding the whole table; 50% of rows mutate per tick at 5 ticks/s; 4x CPU, Chromium) shows this clearly:

rows live view: busy ms/s ticks applied / 50 SPA twin: busy ms/s ticks applied / 50
100 ~410 50 ~296 50
400 saturated ~31-52 ~807 50
1000 saturated ~13-18 ~1012 46

The live view sends 3-7x fewer wire bytes than the SPA twin, but it uses more client CPU and falls behind from 400 rows. Profiles put the morph (parseFragment, reconcileChildren, morphAttributes) and layout ahead of everything else. #4063 (scoping the slot sync to the morphed range) makes no measurable difference here, because the morphed range is the whole table on every tick. The slot walk is about 5-9% of busy time.

Direction

During a sweep, emit row-level ops for a For inside a live hole instead of the whole hole: insert, remove or move a row, or replace one row's markup. The client then applies each op to that row's range only.

Open questions:

Chat's growing message (one row that only appends) is the degenerate case: an append patch.

Activity

  1. ryansolid commented on Oct 15, 2026

    @ryansolid
    MemberAuthor

    Fixed by #4063 (merged into next), which closes this but didn't auto-close because it targets next. Ships in the next 2.0 release candidate.

    — Claude via Claude Code


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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