Solution build time execution increased

  • SQ Enterprise Edition Version 9.9 (build 65466)
  • MSBuildToolVersion.VS2019

Before last promote SQ analysis took about 1h10m (including BuildSolution 31m56s
SonarScannerEnd 26m58s)

Build performance got slower since promotion: total execution time - about 1h30m (BuildSolution - 00:46m38s SonarScannerEnd - 32m45s)

LoC level has not changed much. It means that the analysis scope is not extended, but the execution time gets worse.

What could affect such execution performance changes?
Can we make MSBuild task execution faster somehow?
Do you have an internal LOG so we can enable further insights?


Build performance graph before/after promotion


Hi,

Please give us the version of the Scanner for .NET (MSBuild) that you are using.

And we’ll need the logs:

  • please give us the verbose output of the scanner commands (please run SonarScanner.MSBuild.exe begin /k:“MyProject” /d:sonar.verbose=true as the begin step, and please attach the output of the BEGIN and END steps)
  • please give the output of running MSBuild in verbose mode (/v:d)

Also, please tell us:

  • what are the commands you are running to do the analysis?
  • are you running all commands from the same folder?

In addition, please see the following guide:

 
Ann

1 Like

Hello,

dotnet-sonarscanner&version=5.11.0

Bellow I attached msbuild log and TC build log
IMS.sln.msbuild.log (10.2 MB)
IMS_-IHHU_-_Sonar_SonarQube_Analysis_307.log.zip (7.3 MB)

Hi,

Thanks for the logs. What version did you upgrade from?

 
Ann

from 9.8 to 9.9

Hi,

Thanks for that.

Looking at what changed in C# analysis from 9.8 to 9.9, I only see this, which should have only improved analysis speed, not degraded it.

Now that I’ve seen your logs & gotten an idea of the size of your project, I’m no longer surprised at how long analysis takes. Nonetheless, I’m not seeing anything in the 9.9 changelog that would lead me to expect a longer analysis, so I’m going to flag this for more expert eyes.

 
Ann

Hi @Harry_King,

Thanks for sharing the logs with us. I did take a look trying to understand why the build time increased for you but it’s very hard to tell since I cannot find the logs regarding the solution building (49 min are missing from the logs) and also I don’t have a comparison point.

What I noticed:
10:04:30 - 10:04:33 This is where the begin step runs. No problems here as far as I can tell.

10:04:33 - 10:07:33 Dependencies restore and some other steps not related to us

10:08 - 10:57 A big gap in the logs (I assume that build is happening here but I can only guess)

10:57:20 - 11:27:30 End step of the scanner. This took 30 min.

Could you please update the dotnet build step to run with the following parameters set: /p:reportanalyzer=true /v:d -bl:build.binlog and send us the binary log file?

/p:reportanalyzer=true /v:d parameters are needed to have relevant analyzer performance results included and -bl:build.binlog is needed to ensure binary logs are generated which helps us a lot.

Thanks,
Costin