Perf: Implement chunked streaming for oversized IPC payloads - #332419
Open
Ayush Gupta (Ayush-kathil) wants to merge 2 commits into
Open
Perf: Implement chunked streaming for oversized IPC payloads#332419Ayush Gupta (Ayush-kathil) wants to merge 2 commits into
Ayush Gupta (Ayush-kathil) wants to merge 2 commits into
Conversation
Author
|
@microsoft-github-policy-service agree |
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.
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:
src/vs/base/parts/ipc/common/ipc.tsto detect oversizedVSBufferpackets during serialization.ChunkingProtocolAdapterwrapper aroundIMessagePassingProtocol.1MBare automatically split into chunked packets.ChannelServerandChannelClientautomatically buffer and reassemble incoming chunks asynchronously without blocking the main event loop, yielding viasetTimeout(..., 0).Verification Steps
npm run test -- ipcto verify unit tests pass.