# Sensor C# performance degradation on Microsoft Hosted agents

**URL:** <https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461>\
**Category:** SonarQube Cloud\
**Tags:** dotnet, sonarqube-cloud\
**Created:** [June 6, 2025, 10:28am UTC](https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461 "2025-06-06T10:28:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![PLJAKRZ4](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@PLJAKRZ4](https://community.sonarsource.com/u/PLJAKRZ4)\
**Post date:** [June 6, 2025, 10:28am UTC](https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461/1 "2025-06-06T10:28:58Z")

</div>

- ALM used: Azure DevOps
- CI system used: Azure DevOps
- Languages of the repository: C#, (Detected in analysis: [cs, css, web, xml, json, js, vbnet, yaml])

We are using Microsoft Hosted agents to run analysis, since Monday last week (26.05.2025 ~around 2PM CEST) we are observing a significant increase in time spent on the scanner ( **50-70x** in case of a **large** analysis)  
Before it used to take around 10-15 minutes (we’ve been doing it like this for a while)  
For smaller projects we have also observed an increase, but not as drastic.

Before:

> INFO: Importing 1XXX Roslyn reports  
> Found 8XX MSBuild C# projects: 5XX MAIN projects. 1XX TEST projects. 1XX with no MAIN nor TEST files.  
> Sensor C# [csharpenterprise] (done) | time=88179ms

Currently:

> INFO: Importing 1XXX Roslyn reports  
> Found 8XX MSBuild C# projects: 5XX MAIN projects. 1XX TEST projects. 1XX with no MAIN nor TEST files.  
> Sensor C# [csharpenterprise] (done) | time= **6246000ms**

The amount of projects is exactly the same in both cases.  
All other tasks ran on the agent seem to have similar execution times - so it is probably not the fault of the Microsoft hosted agent, but we can’t rule it out entirely.  
Most tasks in the sonar log except for the C#/VBNET scanner also seem too have similar performance.

All the versions in the log file seem to be exactly the same, runner-image version is the same, Java version etc.

> SonarScanner for MSBuild 10.1.2  
> INFO: SonarScanner 5.0.1.3006

We cannot verify the exact version of Sonar language plugins since they are not printed without DEBUG

We tried passing the following settings:

> sonar.ai.codefix.hidden=true  
> sonar.sca.enabled=false  
> sonar.scanner.scanAll = false  
> And messing the the scope analysis using inclusion/exclusions but achieved no results.

---

<div class="post-metadata">

**Author:** ![kubickim](https://avatars.discourse-cdn.com/v4/letter/k/8dc957/32.png) [@kubickim](https://community.sonarsource.com/u/kubickim)\
**Post date:** [June 6, 2025, 2:56pm UTC](https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461/3 "2025-06-06T14:56:41Z")

</div>

I believe we are seeing this specific issue as well. Our codebase is a mix of C# and [VB.net](http://VB.net), I see these two lines accounting for most of the time:

| 2025-06-06T11:23:02.7567215Z 11:23:02.740 INFO: Sensor C# [csharpenterprise] (done) | time=2379152ms |
| --- | --- |
| 2025-06-06T11:52:51.6284905Z 11:52:51.621 INFO: Sensor [VB.NET](http://VB.NET) [vbnetenterprise] (done) | time=1465773ms |

Within that there is an approx 50/50 split between steps like:

> Importing results from 8 proto files in …  
> Not enough content in ‘[FilePath]’ to have CPD blocks

and the second half importing Roslyn reports:

> Processing Roslyn report: C:\a\1.sonarqube\out\343\Issues.json  
> Adding external issue CA1825: ..  
> Adding normal issue S3236: …

With no standout issue accounting for most cases.

Our hardware is a Azure VM in a scaleset or Standard\_F8s\_v2 machines. The image for this hasn’t been changed.

> SonarScanner for MSBuild 8.0.3  
> SonarScanner 5.0.1.3006

I can provide verbose log files etc privately.  
We noticed this from 2025/06/02, prior to that the analysis of a similar sized PR was taking approx 15 mins total.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 6, 2025, 3:37pm UTC](https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461/4 "2025-06-06T15:37:09Z")

</div>

Hi all,

Thanks for the pings. We’re looking in to this.

@PLJAKRZ4, first welcome to the community! Second, can you confirm that “last Monday” is May 26 (English is so imprecise sometimes.)

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 6, 2025, 4:02pm UTC](https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461/5 "2025-06-06T16:02:20Z")

</div>

Hi again,

We believe we’ve identified the cause and - given that it’s already the weekend for most of our engineers - are planning to tackle it first thing Monday.

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![PLJAKRZ4](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@PLJAKRZ4](https://community.sonarsource.com/u/PLJAKRZ4)\
**Post date:** [June 9, 2025, 5:39am UTC](https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461/6 "2025-06-09T05:39:44Z")

</div>

Hello, yes it was May 26th.

I guess internally on a Friday afternoon I like to believe that Monday after the weekend is further away than it really is.  
Will edit the opening post for clarity

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [June 9, 2025, 10:29am UTC](https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461/7 "2025-06-09T10:29:51Z")

</div>

Hi,

A fix was deployed that should fix the performance issue. We would be happy to hear a confirmation from you that it solved your issue.

Thanks!

---

<div class="post-metadata">

**Author:** ![kubickim](https://avatars.discourse-cdn.com/v4/letter/k/8dc957/32.png) [@kubickim](https://community.sonarsource.com/u/kubickim)\
**Post date:** [June 9, 2025, 12:10pm UTC](https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461/9 "2025-06-09T12:10:54Z")

</div>

We are seeing massive improvement in our Analyze step performance since you’ve rolled out the change. We’ve gone from (pre any problems) taking about 35 minutes for most runs of approx 400 projects to now taking around 5 minutes.

I was a little suspicious at first, but it does appear to be producing the issues and coverage reports we’d expect.

Thanks for the quick responses.

---

<div class="post-metadata">

**Author:** ![PLJAKRZ4](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@PLJAKRZ4](https://community.sonarsource.com/u/PLJAKRZ4)\
**Post date:** [June 9, 2025, 12:34pm UTC](https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461/10 "2025-06-09T12:34:08Z")

</div>

We’ve managed to run a build after the fix.  
We got an execution time within our expectations (sub 10 minutes).

Thank you for the prompt support.

---

<div class="post-metadata">

**Author:** ![jonas.wielage](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jonas.wielage/32/72173_2.png) [@jonas.wielage](https://community.sonarsource.com/u/jonas.wielage)\
**Post date:** [June 9, 2025, 12:51pm UTC](https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461/11 "2025-06-09T12:51:59Z")

</div>

Thanks for the confirmation, that’s great to hear!

If I understand correctly you’re analysis is even faster then before the performance degradation. This is also great news and we already hoped that this is the case.

Do you know which kind of projects are faster now? With the deployed fix, the analysis of CSS / VBNet projects in Pull Requests should be faster then before.

Best

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [June 20, 2025, 8:00am UTC](https://community.sonarsource.com/t/sensor-c-performance-degradation-on-microsoft-hosted-agents/142461/13 "2025-06-20T08:00:05Z")

</div>

Closed on June 20, 2025, 8:00am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
