Is Sonar Analysis expected to take 25 minutes for 600K Lines of code?

  • ALM used: GitHub
  • CI system used: Azure DevOps
  • Scanner command used when applicable (private details masked): mvn sonar:sonar
  • Languages of the repository: Java, Kotlin, Typescript

Hi,
We are using SonarCloud to analyze our project for a few weeks now. We are quite happy with the feedback provided by Sonar however the analysis is taking roughly 25 minutes to run which is pretty slow.

Is this the standard analysis time for a similar code base size or is it slower than expected?

If it’s slower than expected could you please point me in some direction to analyze why it’s slow? The logs contain a few “Slowest analyzed files:” but they doesn’t seem to add up to something significant.
Is there a way to enable some incremental analysis to only analyze files changed since last analysis?
The log seem to indicate that analysis is done sequentially?Is there a way to parallelize analysis ?

Seb

Hey @Sebastien_Arod,

It is very hard to estimate whether 25 minutes in your case is good or bad solely based on the number of lines of code and languages involved. The scanning time can depend on many factors such as code logic or hardware.

Is there a way to parallelize analysis?

Currently, there is no way to parallelize analysis.

Is there a way to enable some incremental analysis to only analyze files changed since the last analysis?

We do not support incremental analysis as it can result in less accurate scanning results

Best,
Marcin

Hello @Sebastien_Arod,

Since you posted your feedback I believe things improved a lot especially on the Kotlin part.
You could expect now to scan your 600K LOCs in less than 15min.

Still, we just released a new version of the Java analyzer which accept a property sonar.java.experimental.batchModeSizeInKB activating an experimental feature keeping more data in memory which has a significant impact on the speed of analysis for Java projects (between 10 to 90% increase according to our tests).

Would you be OK to test this property and share a before / after comparison?

You can start with sonar.java.experimental.batchModeSizeInKB=1024 and increase it gradually.

Thanks
Alex