Skip to content

Perf: Implement chunked streaming for oversized IPC payloads - #332419

Open
Ayush Gupta (Ayush-kathil) wants to merge 2 commits into
microsoft:mainfrom
Ayush-kathil:perf/ipc-chunking
Open

Perf: Implement chunked streaming for oversized IPC payloads#332419
Ayush Gupta (Ayush-kathil) wants to merge 2 commits into
microsoft:mainfrom
Ayush-kathil:perf/ipc-chunking

Conversation

@Ayush-kathil

Copy link
Copy Markdown

Fixes

Fixes #332418

Description

What this PR does:
This PR introduces automatic payload chunking at the core IPC layer to prevent Extension Host messages from freezing the Renderer UI thread.
Currently, when the Extension Host sends massive payloads to the Renderer (e.g., thousands of diagnostic markers, massive search results, or huge string buffers), it serializes and transmits the entire object synchronously over the RPC protocol bridge. If this payload exceeds a few megabytes, the deserialization and processing block the UI event loop, causing the renderer to freeze, drop frames, or display the "Window is not responding" dialog.
Architectural Changes:

  • Modifies src/vs/base/parts/ipc/common/ipc.ts to detect oversized VSBuffer packets during serialization.
  • Introduces a ChunkingProtocolAdapter wrapper around IMessagePassingProtocol.
  • Messages exceeding 1MB are automatically split into chunked packets.
  • ChannelServer and ChannelClient automatically buffer and reassemble incoming chunks asynchronously without blocking the main event loop, yielding via setTimeout(..., 0).

Verification Steps

  1. Run npm run test -- ipc to verify unit tests pass.
  2. Launch the Extension Host and trigger an extension that sends >10MB of diagnostics or search results.
  3. Observe via the Developer Tools Performance profiler that the UI remains responsive (60fps) during transmission, as the massive payload is chunked and streamed.

Copilot AI balanced review requested due to automatic review settings August 24, 2026 19:34

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Ayush-kathil

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

[Performance] Prevent Renderer freezes by implementing chunking/streaming for oversized IPC payloads

3 participants