Skip to content

perf: compare visible media without serialization - #12250

Merged
mscolnick merged 1 commit into
mainfrom
kg/mo-8797-kernel-event-copies
Dec 3, 2026
Merged

mscolnick merged 1 commit into
mainfrom
kg/mo-8797-kernel-event-copies

Conversation

@kirangadhave

@kirangadhave kirangadhave commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

📝 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.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit a8915b2.

@kirangadhave
kirangadhave requested a balanced review from Copilot December 3, 2026 01:03
@kirangadhave
kirangadhave marked this pull request as ready for review December 3, 2026 01:03
@kirangadhave
kirangadhave requested a review from manzt December 3, 2026 01:03
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./frontend

Status Category Percentage Covered / Total
🔵 Lines 69.24% 28694 / 41438
🔵 Statements 69.19% 29249 / 42270
🔵 Functions 64.55% 6895 / 10681
🔵 Branches 64.66% 16823 / 26014
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
frontend/src/core/notebook/replica/resources/executions.ts 95.89% 90.84% 100% 95.77% 121, 194, 204, 242, 247, 269
Generated in workflow #26503 for commit a8915b2 by the Vitest Coverage Report Action

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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
mscolnick merged commit 0cd19e0 into main Dec 3, 2026
32 checks passed
@mscolnick
mscolnick deleted the kg/mo-8797-kernel-event-copies branch December 3, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants