Trim lsp dispatch allocations - #84651
Merged
Merged
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6916157a-dea6-4065-98b5-dc87c9c217b3
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6916157a-dea6-4065-98b5-dc87c9c217b3
dibarbet
force-pushed
the
trim-lsp-dispatch-allocations
branch
from
July 27, 2026 23:19
4606b8a to
b680441
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces per-request allocations in the Language Server Protocol framework dispatch path by removing an async state machine and avoiding a capturing cancellation callback, and it also updates a NuGet dependency version used by the Language Server layer.
Changes:
- Remove
async/awaitfromSystemTextJsonLanguageServerrequest entrypoint to avoid state machine allocation. - Replace a capturing
CancellationToken.Registercallback inQueueItem<TRequestContext>with a static callback + state to avoid closure allocation. - Bump
NuGet.ProjectModelversion ineng/Packages.props.
Show a summary per file
| File | Description |
|---|---|
| src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/SystemTextJsonLanguageServer.cs | Removes async wrapper around InvokeAsync to reduce dispatch overhead. |
| src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs | Avoids closure allocation in cancellation registration by using a static callback and state. |
| eng/Packages.props | Updates NuGet.ProjectModel package version for Language Server dependencies. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
JoeRobich
approved these changes
Jul 28, 2026
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.
Microsoft Reviewers: Open in CodeFlow