Skip to content

perf(web): avoid reparsing unchanged history during streaming #434

Description

@tt-a1i

Problem

After #384, streaming updates rebuild Transcript row elements and re-run react-markdown for unchanged historical replies. At main 5262158264803d4c7b260e1596c3a7ae69d91cb2, a real Transcript regression with 24 history replies and 8 live updates records 216 history parses (24 initial + 192 repeated), plus 9 live parses.

Scoped repair

Memoize only the Markdown component using its existing string prop and React's default comparison. Preserve live text changes, historical corrections, Session changes, sanitization, scrolling and component lifetime; do not add a global cache or memoize execution state.

Acceptance

The same regression should record 24 history + 9 live parses, reparse corrected text, and reparse after unmount/remount. Pass required repository and browser checks. These are deterministic invocation counts, not a wall-clock benchmark or an end-to-end speed claim.

Evidence record for this work: Web streaming Markdown investigation.

Activity

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