Azure Dev Ops / c# / Slow build times

Template for a good new topic, formatted with Markdown:

  • ALM used : Azure DevOps
  • CI system used : Azure DevOps
  • Languages of the repository: C#
  • Error observed: Extremely slow build times

We are trialing Sonar Cloud, and our build times have gone from 10 minutes, so not finishing after 2 hours.
I have tried disabling warning that appeared the most (Using clause which was unusued), but this doesn’t seem to have an impact.

All the threads on here about it reference bugs that look to be fixed.

I don’t really know where to start debugging or getting support. Is this expected behaviour? ITs about 150 cs projects, none of them very big.

Hi Tank104,

Welcome to the community support!

Could you clarify a little bit?
Are you saying that you build 150 projects C# and it went from 10 minutes to more than 120 minutes?

Does this mean you run SonarCloud analysis on each project?

If t’s the case and we consider the following:

  • the SonarCloud scanner scans every project = 150 analysis to perform
  • each analysis takes 1 minute to scan the code which is quite fast (but can be improved if the scope is reduced to the minimum) = 150 minutes of code analysis. Even with a 30 seconds step, the build time will be multiplied by 8.

At this scale, 150 projects, every new step which does something signififcant (and the scanner does look for a lot of things) will obviouly make the whole process longer.

Could you provide a couple of background task ids?

Thanks for using our product.

Best.

Hi Olivier,
A background task example is AXU0Gk3BKGBZPjxNtwmS

In our situation (where we have a big monolith), and the time is as expected - how often would you run analysis then? We wanted to run it on every Pull Request, so that we could see any warnings in the PR review stage - which I understand we can do. But with it adding 3 hours on, its just not feasible everytime.
We could run it once a week to review I guess…

Are there certain checks we can turn off to get the time taken right down?

Hi @tank104

Overhead is expected on the build step, no matter how many projects you have. But in your case, it’s certainly too much.

Would it be possible to share the build log (i’ll send you a PM) so that we can review it with our analyzers expert ?

Thanks in advance.
Mickaël