You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Track and investigate performance bottlenecks in the VS Code webview UI (packages/vscode-webui). As chat sessions grow (long message histories, frequent streaming updates, many tool invocations), users may experience slow rendering, sluggish input, and high memory usage inside the Pochi panel. This issue is intended to collect findings, profiling data, and potential optimizations.
Scope
The investigation should cover (but is not limited to):
Web worker boundary cost and message payload sizes between the webview and extension host.
Suspected hotspots
No list virtualization — MessageList maps over all messages and all their parts. Long conversations (100+ messages, many tool calls) force a full re-render on each streaming tick.
Per-render flatMap calls — getToolCallCheckpoint and getUserEditsCheckpoint in message-list.tsx allocate new arrays on every render per part.
Missing memoization — Part, TextPartUI, UserAttachments, and UserActiveSelections are not wrapped in React.memo; they re-render whenever the parent does, even when their inputs are unchanged.
Streaming markdown re-parse — streaming tokens may trigger full markdown re-parse per token rather than diff-based updates.
Summary
Track and investigate performance bottlenecks in the VS Code webview UI (
packages/vscode-webui). As chat sessions grow (long message histories, frequent streaming updates, many tool invocations), users may experience slow rendering, sluggish input, and high memory usage inside the Pochi panel. This issue is intended to collect findings, profiling data, and potential optimizations.Scope
The investigation should cover (but is not limited to):
packages/vscode-webui/src/components/message/message-list.tsx— renders all messages without virtualization; eachPartcurrently re-renders on every state update.getToolCallCheckpointflattensmessagesviaflatMapinside everyPartrender — O(N*M) work per render.getUserEditsCheckpointre-iterates messages per user message.packages/vscode-webui/src/components/message/markdown.tsxpackages/vscode-webui/src/components/message/code-block.tsx(onlyCodeBlockis memoized today)code-highlighter.tsxpackages/vscode-webui/src/features/toolspackages/vscode-webui/src/features/chat/lib/use-live-chat-kit-getters.tsmermaid.tsxpackages/vscode-webui/src/livestore.default.worker.tsSuspected hotspots
MessageListmaps over allmessagesand all theirparts. Long conversations (100+ messages, many tool calls) force a full re-render on each streaming tick.flatMapcalls —getToolCallCheckpointandgetUserEditsCheckpointinmessage-list.tsxallocate new arrays on every render per part.Part,TextPartUI,UserAttachments, andUserActiveSelectionsare not wrapped inReact.memo; they re-render whenever the parent does, even when their inputs are unchanged.Proposed investigation steps
reportWebVitals.tshook (INP is most relevant).@tanstack/react-virtual).messageschange.Acceptance criteria
Additional context
Recent related work:
@pierre/diffs🤖 Generated with Pochi | Task