microsoft / microsoft/vscode

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

Open
#332,418 1 comment 0 reactions 1 assignee Claimed by @deepak1556 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## The Problem
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.

---

## The Solution
Implement a chunking mechanism directly at the `ipc.ts` layer.

- If a serialized `VSBuffer` exceeds a predefined `MAX_CHUNK_SIZE` (e.g., 1MB), it should be split into smaller `ChunkedMessage` packets.
- These packets are then reassembled on the receiving end.

This prevents a single massive message from locking the event loop.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.