dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.98k stars 4.03k forks source link

"Perform editor feature analysis in external process" should likely be turned on by default. #26076

Closed CyrusNajmabadi closed 5 years ago

CyrusNajmabadi commented 6 years ago

this is in reference to this feature:

image

This feature was A/B tested probably around a year ago at this point. @kuhlenh has the details. All data was extremely good. It showed substantial improvements in some areas, and no regressions anywhere.

I think this can become non-"experimental" at this point and can just become the default.

CyrusNajmabadi commented 6 years ago

tagging @dotnet/roslyn-ide @kuhlenh @jinujoseph

Any reason not to do this at this point? The A/B test helped address any concerns we had about potential instability or possible negative perf impact.

rollsch commented 6 years ago

Can I get some more information on what this does and how it improves performance?

CyrusNajmabadi commented 6 years ago

tagging @dotnet/roslyn-ide @kuhlenh @jinujoseph

Any reason not to do this at this point? The A/B test helped address any concerns we had about potential instability or possible negative perf impact.

CyrusNajmabadi commented 6 years ago

@rolandh

Can I get some more information on what this does and how it improves performance?

The feature works by making 'global' IDE operations run in a separate process. These include operations like:

  1. Find all references.
  2. Navigate to.
  3. Add using.
  4. Rename

Basically, features that need knowledge of all the semantic information in your solution. By moving these operations into a separate process it greatly reduces load inside VS. Specifically, many of these feature are quite expensive to perform, both in CPU and in terms of memory allocations. The latter is a particularly large problem as it bogs down the single GC system inside VS. So, if you're doing these features in VS, with a large solution, you can often get slowdowns and latency spikes as the GC has to pause things to deal with the enormous pressure. By moving out of proc the VS GC no longer has to worry about that, and things like latency spikes drop by quite a bit.

Brain2000 commented 5 years ago

Looks like someone forgot to turn this on. Could it have anything to do with this: https://developercommunity.visualstudio.com/content/problem/532880/live-code-analysis-slow.html

I also find it amazing that the Live Analysis continues to run even after closing all solutions.

CyrusNajmabadi commented 5 years ago

These are unrelated features. The issue i opened was about movin certain features (like find-references/rename/navigate-to/etc.) out of process. Live Analysis is not included in that bucket. If you are running into problems there please open another bug. This was has been closed appropriately and no further work will be done here based on reports about other features. Thanks!

Brain2000 commented 5 years ago

@CyrusNajmabadi The screenshot displayed above has "Perform editor feature analysis in external process". I ask because this option is no longer available, and now devenv.exe consumes multiple cores worth of processing. The freezing has become so bad in version 16.2 that I ended up having to to isolate and suspend the thread in devenv.exe running the analysis, just so I could work.

CyrusNajmabadi commented 5 years ago

@Brain2000 As i mentioned, the above option was solely for a subset of features that i created. All those features now run out of proc and do not have an impact on the CPU usage of VS. The option is no longer available because those features are now never in VS anymore.

and now devenv.exe consumes multiple cores worth of processing.

This is unrelated to the features i wrote or this specific issue. I would recommend filing performance bugs against VS.

The freezing has become so bad in version 16.2 that I ended up having to to isolate and suspend the thread in devenv.exe running the analysis, just so I could work.

As i mentioned above, please file another issue on this. The option this issue refers to never ahd any impact on things like 'live analysis'.

jmarolf commented 5 years ago

@Brain2000 I would really appreciate it if you could follow the directions here and record a trace of the problem you are seeing.

sharwell commented 5 years ago

@mavasani this looks like another instance of the runaway dispose analyzer issue