Investigate changes to LSP pull-diagnostics to make it more efficient. #72868
Labels
Area-Performance
Investigating
LSP
issues related to the roslyn language server protocol implementation
Milestone
Right now, the protocol is not efficient at all, sending huge messages, and requiring lots of information to have to be sent back and forth. We should investigate improvements to the protocol to remove redundancy, and allow for the queries that we are passed to be much smaller in scope (like asking for project level diagnostics, not solution level).
Options we should examine:
When possible, not including data, and moving it to a 'resolve' step. A possible candidate for this is Diagnostics.CodeDescription.Href. This is often a large string like "{https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055}", on top of the json for
"CodeDescription"={"Href"="{https://...}"}
. Moving to resolving this only if and when needed by the UI would be helpful.Moving repetitive data to a common header location. A common example is the information about the associated project for a particular diagnostic which is usually repeated over all diagnostics. This is normally an array like
"Projects"=[{"ProjectIdentifier"="...guid...",ProjectName="Potentially.Long.Project.Name"}]
. Placing this info about each referenced project up front would allow each diagnostic to then reference these by index, greatly reducing the size.Moving certain strings to enums.
"DiagnosticType"="Style"
could just reference a number instead.Compressing how we encode data. Ranges are the most egregious problem. Needing to send
"Range"={"Start"={"Line"=6,"Character"=15},"End"={"Line"=6,"Character"=27}}
where"Span"="45,12"
would do.The text was updated successfully, but these errors were encountered: