Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

Fixes #67014

Here's my general reasoning on why the simplest and cleanest thing to do here is to just disable this functionality:

First, we are moving to LSP pull-based-diagnostics. In that world, preview-window diagnostics do not work anyways, as the preview window refers to documents that LSP knows nothing about (so it has no URI with which to even query the host about this stuff).

Second, If/when we do update LSP itself to support the concept of 'previews' it will be against the LSP workspace. That workspace either is already running out of proc for us, or it's already the in proc workspace that already does diagnostics out of proc.

So, having the preview workspace compute diagnostics is a point in time thing going away very soon. And given the high amount of perf impact, and the low value (how often is it even shown that there's a squiggle in the preview pane, and how useful is that to even see?), it's best to just disable this functionality fully, and decide if we want it in the future if LSP ever moves to supporting this.

This was always a nifty system that demonstrated that roslyn is truly working on real snapshots that can speculate about the future. But diagnostics are extremely expensive (forcing generators to run, and all analyzers), just to maybe populate a squiggle in a preview window that appears for a few seconds. It's reasonable to disable this functionality for the large win we get not doing duplicate work. And this is better than still having hte preview call to OOP to do the work, still causing the forking, source-generators and analyzers to all run (albeit in OOP instead of inproc).

@CyrusNajmabadi
Copy link
Member Author

Tagging @arkalyanms as well. @mavasani can you try out this and #67027 together and see if it helps for you.

@mavasani
Copy link
Contributor

Merging to facilitate lightbulb performance measurements with this change.

@mavasani mavasani merged commit b80df1b into dotnet:main Feb 24, 2023
@ghost ghost added this to the Next milestone Feb 24, 2023
@sharwell
Copy link
Contributor

sharwell commented Feb 24, 2023

This is a valuable feature and should not be removed, particularly without a team discussion.

@CyrusNajmabadi CyrusNajmabadi deleted the disablePreviewDiagnostics branch February 25, 2023 02:14
@RikkiGibson RikkiGibson modified the milestones: Next, 17.6 P2 Mar 2, 2023
@mavasani mavasani added the Performance-Scenario-Diagnostics This issue affects diagnostics computation performance for lightbulb, background analysis, tagger. label May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Performance-Scenario-Diagnostics This issue affects diagnostics computation performance for lightbulb, background analysis, tagger.

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Move PreviewWorkspace diagnostic computation to OOP

5 participants