perf(messages): reduce rerenders during streaming#144
Merged
Dimillian merged 4 commits intoDimillian:mainfrom Jan 20, 2026
Merged
perf(messages): reduce rerenders during streaming#144Dimillian merged 4 commits intoDimillian:mainfrom
Dimillian merged 4 commits intoDimillian:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR optimizes rendering performance during message streaming by isolating timer updates and memoizing individual message rows. The key optimization moves timer state management into a memoized WorkingIndicator component, preventing unnecessary rerenders of message items when only the timer updates.
Changes:
- Extracted message rendering logic into memoized row components (MessageRow, ReasoningRow, ReviewRow, DiffRow, ToolRow)
- Created a memoized WorkingIndicator component with isolated timer state
- Wrapped callback functions with useCallback for stable references across renders
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/features/messages/components/Messages.tsx | Refactored Messages component to use memoized row components and moved timer state to WorkingIndicator, achieving ~200× reduction in rerenders during streaming |
| package-lock.json | Updated dependency metadata by removing "peer": true flags from various packages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
This is really good, thanks! |
gersmann
pushed a commit
to gersmann/codex-monitor-web
that referenced
this pull request
Mar 10, 2026
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
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
Perf Validation
Methodology:
Results:
Note: harness was temporary and not committed; results recorded during local run.
Testing