Repository navigation
Conversation
Keep recording executions between display frames. Reuse private member maps until a frame takes a snapshot, then copy on the next write so earlier frames keep their records.
Contributor
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The frame test does not catch allocation regressions because it also passes with the old copy-per-event implementation; deterministic identity or allocation-count coverage is needed.
1 open issue
What changed in this PR
Reduces execution-map copying in the host-protocol run history while preserving stable display snapshots.
Changes:
- Reuses unpublished member maps and copies them on the first write after publication.
- Captures history snapshots when display frames publish.
- Adds a test for snapshot stability across frames.
| File | Description |
|---|---|
frontend/src/core/notebook/replica/run-history.ts |
Reuses draft maps until snapshot publication. |
frontend/src/core/notebook/replica/frame.ts |
Snapshots history during frame publication. |
frontend/src/core/notebook/replica/__tests__/frame.test.ts |
Tests that published execution maps remain stable. |
Review effort: Balanced
| continue; | ||
| } | ||
| let members = copied.get(runId); | ||
| let members = run && drafts.get(run.executions); |
Contributor
Coverage Report for ./frontend
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
mscolnick
approved these changes
Dec 3, 2026
mscolnick
merged commit Dec 3, 2026
40510ee
into
trevor/mo-8406-read-the-runs-panel-from-the-host
26 of 27 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This pull request was authored by a coding agent.
📝 Summary
Stacked on #12180. Capture each execution as it arrives and reuse its run’s private member map until the next display frame. The first write after publication copies the map so an earlier frame keeps its original entries.
A local replay sent 1,000 cells through queued, running, and completed states on both revisions. With one display frame per 32 messages, median time from transport-message handling through frame publication fell from 320 ms on #12180 to 243 ms on this branch. This branch was faster in all 12 paired replays. Both revisions published the same 94 frames, and earlier snapshots kept their original records.
The base constructed 3,000 history member maps and copied 2,499,500 entries. This branch constructed 94 and copied 77,841 entries. In a 500-cell control that published after every message, both versions copied the same number of entries. The replay used one subscriber and excluded browser rendering. History still scans the live executions on each update.
Part of MO-8797.
📋 Pre-Review Checklist
✅ Merge Checklist