Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 High CPU on input (CodeLens)

I am using Visual Studio Professional 2017 15.2 (26430.14) and my CPU is between 40-60% on my PC everytime I am writing code. It is really anying since it creates a lag for every character input. Sometimes several seconds. I should state that my PC is not of the most performant kind, but I do have SSD and 16 GB of RAM.

I have Resharper and NCrunch installed, but I have tried to disabled them, but without any result.

The process that spikes the CPU is:

  • devenv.exe

And also sometimes:

  • ServiceHub.RoslynCodeAnalysisService32.exe
like image 973
オスカー Avatar asked Aug 02 '17 16:08

オスカー


1 Answers

The cause of my problem was something called "CodeLens" (https://msdn.microsoft.com/library/dn269218.aspx). This is some kind of realtime analysis of the code giving you references and usage direct within the code. I guess it was a little bit to hard on my weak machine.

When I turned this feature off my lag disappeared instantly. You can turn it off here:

  • Options
    • Text Editor
      • All Languages
        • CodeLens
like image 165
オスカー Avatar answered Oct 30 '22 05:10

オスカー