Skip to content

🤖 perf: let React Compiler compile MessageRenderer and AssistantMessage - #4428

Merged
ThomasK33 merged 1 commit into
mainfrom
perf-compiler-messages
Sep 24, 2026
Merged

ThomasK33 merged 1 commit into
mainfrom
perf-compiler-messages

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Summary

MessageRenderer and AssistantMessage now compile under React Compiler and leave the guard baseline. Both render once per transcript row.

Implementation

  • MessageRenderer reassigned its destructured message prop (message = useStreamingMessageDelta(...)), which the compiler can't lower. The prop is now destructured as messageProp, and the streamed value is a new const message.
  • AssistantMessage's fork handler had ?? inside try/catch; it now uses runWithCatch with the same body and error handler.

Validation

  • Guard: 13/18 hot components compile (5 known skipped).
  • src/browser/features/Messages unit tests (incl. MessageRenderer.test.tsx) and tests/ui/chat/forkFromResponse.test.ts pass.

Measurements

Electron perf e2e (tests/e2e/scenarios/perf.*.spec.ts, XUM_PROFILE_REACT=1), local, serial, 3 runs each, medians. Baseline is main at 349657d; "after" is the top of this stack (#4429), because the layers were measured together. React time is the summed actualDuration of the profiled subtrees.

Scenario Profiled subtree main stack top
Open chat with a 1000-file review chat-pane.transcript 388 ms 292 ms
Open chat with a 1000-file review chat-pane.input 76 ms 61 ms
Open chat with a 1000-file review all profiled 530 ms 424 ms
Open workspace, large history chat-pane.transcript 331 ms 295 ms
Open workspace, large history chat-pane.input 52 ms 46 ms
Open workspace, medium history chat-pane.transcript 206 ms 191 ms

Commit counts are unchanged; the gain is less work per commit. Typing in a large chat and the review hunk specs show no change beyond noise. ChatInput alone, measured before #4418 landed: New Workspace typing went from 165 CreationControls renders per run to 2.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $4.05

@ThomasK33
ThomasK33 added this pull request to stack #4430 September 24, 2026 11:31
@ThomasK33 ThomasK33 changed the title perf: let React Compiler compile MessageRenderer and AssistantMessage 🤖 perf: let React Compiler compile MessageRenderer and AssistantMessage Sep 24, 2026
@ThomasK33
ThomasK33 marked this pull request as ready for review September 24, 2026 11:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-24T15:30:20.306797Z a973197 New commits
🔒 Security Review ✅ Completed 2026-09-24T15:32:14.827498Z a973197 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33
ThomasK33 force-pushed the perf-compiler-messages branch from 2b07954 to 6bd012d Compare September 24, 2026 12:42
@ThomasK33
ThomasK33 added this pull request to the merge queue Sep 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue because a pull request earlier in the stack was removed Sep 24, 2026
@ThomasK33
ThomasK33 force-pushed the perf-compiler-messages branch from 6bd012d to b88dcc7 Compare September 24, 2026 14:45
@ThomasK33
ThomasK33 added this pull request to the merge queue Sep 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 24, 2026
Base automatically changed from perf-compiler-chatpane to main September 24, 2026 15:28
@ThomasK33
ThomasK33 force-pushed the perf-compiler-messages branch from b88dcc7 to a973197 Compare September 24, 2026 15:28
@ThomasK33
ThomasK33 added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit 733e713 Sep 24, 2026
30 of 31 checks passed
@ThomasK33
ThomasK33 deleted the perf-compiler-messages branch September 24, 2026 16:00
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.

1 participant