Performance of Sonarqube for Visual Studio, using 100% CPU in large repository

Please provide

  • Operating system: Windows 11 Build 22631
  • Visual Studio version: 17.13.4
  • SonarQube for Visual Studio plugin version: 8.14.0.12562
  • Programming language you’re coding in: C# and VB.NET
  • Is connected mode used: Yes
    • SonarQube Server v10.8.1

And a thorough description of the problem / question:
Sometimes Sonarqube for Visual Studio is consuming 100% CPU on all 16 cores, slowing down the entire system.
I cannot trace the trigger to a specific action like opening a certain file, it seems occurring randomly. When it occurs it last for some time, maybe indefinitely. I have to restart Visual Studio to fix the problem.

I can say that it comes from Sonarqube because I don’t have this problem when the extension is disabled.
In addition I captured profiling traces (which I can provide) that shows CPU time spent in libgit2sharp used by Sonarqube functions (for instance SonarQubeService.GetProjectBranchesAsync for 90% CPU time).

This occurs with a large solution and repository, here are a few details about it:

  • Code mix of VB.NET + C#
  • ~180 projects
  • ~1M LoC
  • ~60,000 commits in main branch
  • ~4000 branches

Hi,

Welcome to the community and thanks for this report!

Could you double-check your SonarQube for Visual Studo version? The latest release is 8.14. :sweat_smile:

 
Thx,
Ann

1 Like

My apologies the version is 8.14.0.12562.

Hello @lucas-loegel_wkl

Thank you for reporting the performance issues you’re experiencing with SonarQube for Visual Studio.

We have investigated this issue and identified a threading problem within the code responsible for branch matching. It appears that the matching branch is being calculated multiple times concurrently from different threads. Given that your repository contains a significant number of branches (approximately 4000), this redundant computation can indeed lead to the high CPU utilization and performance degradation you are observing.

We have created a ticket on our backlog to address this issue: Jira.

We understand the impact this is having on your workflow and have prioritized this fix for our upcoming sprint. We will keep you updated on the progress through the ticket.

In the meantime, unfortunately, there isn’t a straightforward workaround we can suggest within the SonarQube for Visual Studio extension itself to directly mitigate this specific threading issue.

Thank you for your patience and understanding as we work to resolve this.

Kind regards,

1 Like