ReSharper 2022.1.x slowing down VisualStudio 2022 massively

VisualStudio 2022 was smoth and fast with ReSharper 2021.x installed. After update to 2022.1.x it started to slow down massively. The GUI constantly hangs and freezes for several seconds, inputs are delayed, etc. The yellow bar on top states that ReSharper is slowing down VisualStudio. I allready followed the performance tips in options as long as I was willing to set the recommended options.

12 comments
Comment actions Permalink

Hi Sven M

Thank you for the report. 

If you notice that ReSharper slows down Visual Studio, please help us to determine the cause of the issue by profiling Visual Studio - follow the instructions described here to collect a snapshot.

Looking forward to hearing from you! 

 

0
Comment actions Permalink

That is not possible. I cannot figure out how to reproduce the problem. It randomly occurs while typing, while debugging, while loading project, while opening files, but I can not reproduce it and start profiling before. And when it occurs I can do nothing but wait. After VS comes responsive again it does not make sense to start profiling because it could be minutes or even hours until the problem starts again.

0
Comment actions Permalink

Hi Sven M

Thank you for the answer. 

Could you please collect logs after the case? For this: 

  • run Visual Studio with the following command line: 'devenv /ReSharper.LogFile C:\log\resharper_log.txt /ReSharper.LogLevel Verbose'
  • work normally until VS hangs
  • attach the corresponding 'resharper_log.txt' file.

One can upload the resulting file to our server.

Also, please add this information: 

  • what are the project types you work with? 
  • are there any large files opened or contained in the project? 
  • what type of files/projects do you load when it happens? 

As to the profiling, one can use the command-line tool if this is an option for you. 

0
Comment actions Permalink

See Upload ID "2022_05_13_QKJFcFh4yLdggKe3".

0
Comment actions Permalink
  • what are the project types you work with? 
    ASP.NET MVC 5, Console Applications, Azure WebJobs
  • are there any large files opened or contained in the project? 
    Nothing special I think.
  • what type of files/projects do you load when it happens? 
    Changing branches or start of debug, nothing I can really specifiy.
0
Comment actions Permalink

One more VS freeze for nearly a minute after changing branch and wanted to start to open some files/tools: Upload ID "2022_05_13_9DEzs9ZWFEpKyTkn"

0
Comment actions Permalink

Solved 

So, I was actually Profiling Visual Studio while I run it under the Resharper verbose logging command. In the first minute after starting and opening the solution there was nearly 60GB of Memory allocation, 10 seconds of UI Freeze und nearly 20% of cpu time consumed by GC.
Stats that every professional would tell you, that your application has serious issues -laugh- but, its not directly Resharpers fault as it turned out.

It seems there is some bad synergy between VS 17.2 / Resharper 2022.1.1 and a little bad nuget package: CommunityToolkit.Mvvm in Version 7.12.
I actually had this package on a single small library, and not even used - i havent referenced a single type (yet), BUT, it installed MVVM analyzers and (most obviously more responsible for this s**it) source generators into every single project of the solution, even the static asset libraries. And somehow, in VS 17.2 there seems now to be a situation, where these 3 participants move into each others way continously, leading to extreme allocations, and freezes. I was wondering why i got such extreme complete UI stucks, with the cpu not even under load, and also not much blocking from file access, but to me it explains a lot, also why ReSharper felt like kicking in too aggressively and too often - i assume its the source generators, that are causing this. So far, until VS17.2/2022.1.1 these things never caused issues, but after removing this little nuget, everything is back to normal for the moment: Allocations are low (even less memory used by Resharper than previously), full analysis on all large files dont let resharper use more than 6- 8 at max GB (and only temporartly before dropping back to like 3GB), repeated builds without freezes. Thankfully that MVVM toolkit was just something I had in one package, out of interest , not being dependant on it - so removing it causing not a single issue. 

Maybe this helps others too...

 

I can only confirm Sven M's experience.
The update to VS 17.2 felt like being thrown back to a bad experience i had years ago.
Sometimes minute long UI freezes, 40GB of Memory Usage from background analysis of a single large file (before 17.2 memory usage never went above single digit numbers, vs complete frezees so i have to crash it - and twice it even lead to a complete computer freeze. All gone when i disable resharper. 

One thing that was quite obvious to me, Resharper kicks in too aggressively on this VS version. Im publishing a project, the process is not even done, Resharper starts the intense "project sync". I dont know much about the internals of Resharper, but it seems like it doesnt use its cache as efficient as it used to be - so often intensive syncs starting, just because i saved a single js or whatever. And while VS always at least remained usable during syncs, with 17.2 - its extreme. And  before you ask: All my files are on PCie SSDs. Somestimes Resharper does syncing even when nothing happened in 10 minutes (verified by filesystem attributes). 

Im gonna run mine with the commands you suggested and will upload the reports.


EDIT: Side, the same freezes i also experience in DotPeek (not within VS, the application), i often select a couple of assemblies, and before I can even hit the generate pdb button, the app freezes and never unfreezes again - i have to kill it from the task manager then.

1
Comment actions Permalink

I have no package "CommunityToolkit.Mvvm" installed. But the too often and too long synching I can confirm.

0
Comment actions Permalink

Hi @Sven M!

Thank you for the logs. Unfortunately, there are not enough useful details there. 

Please try to profile the hang with a stand-alone dotTrace: 

  • Launch VS with your project
  • Follow this manual, steps 1-4. Leave Collect profiling data from start enabled. 
  • Work as usual until VS hangs 
  • Follow the manual from step 5 (click start and collect snapshot). 
  • upload the resulted snapshot. 

Thank you in advance! 

0
Comment actions Permalink

Upload ID "2022_05_17_ESuVkG5cFxxgMTnt"

Snapshot directly after a long hang of VS (after switching branch and merging)

0
Comment actions Permalink

One more even longer hang: Upload ID "2022_05_17_AYxgSJYvimWtHM7w"

0
Comment actions Permalink

Hi Sven M

Thank you for the snapshot! I've created an issue for further investigation. Feel free to follow it.  

Could you please tell me, how did you update your ReSharper last time? Also, could you please try our EAP and check if the problem persists? Thanks! 

0

Please sign in to leave a comment.