Repository navigation
perf: compare visible media without serialization - #12250
Merged
Merged
Conversation
Contributor
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Contributor
Coverage Report for ./frontend
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the notebook output-comparison optimization.
No open issues 🎉
What changed in this PR
Optimizes notebook output comparisons without changing cleared-output behavior.
Changes:
- Compares visible media by identity, MIME type, and data instead of serialization.
- Preserves content comparison for failure, cancellation, and skip outcomes.
- Tests that equivalent output stays cleared while data or MIME-type changes restore visibility.
| File | Description |
|---|---|
| frontend/src/core/notebook/replica/resources/executions.ts | Adds direct media comparison to avoid serialization. |
| frontend/src/core/executions/__tests__/output-lifecycle.test.ts | Tests cleared-output behavior across media updates. |
Review effort: Balanced
mscolnick
approved these changes
Dec 3, 2026
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.
📝 Summary
Compare visible media by identity, MIME type, and data when deciding whether to advance the output version. This avoids serializing both copies of an HTML, JSON, or image payload on each comparison. Equivalent replacements keep a cleared output hidden. Changing the data or MIME type makes it visible again. Distinct failure, cancellation, and skip outcomes keep their existing content comparison.
In a 12-cell reducer replay, 192 updates with 562-byte JSON payloads took 0.935 ms on main and 0.164 ms with this change. These are medians from eight alternating rounds after warmup, with input parsing outside the timer. All 576 tested transitions matched main for output version, displayed value, and clearing behavior.
Addresses the output-comparison part of MO-8797.