SonarCloud on Travis speed-up tips

Hi all,

as mentioned e.g here and here, SonarCloud deployed new CFamily plugin.
In our project it resulted in noticeable slowdown of the analysis, resulting in timeout of the build.

In this topic, I would like to gather tips how to speed-up the analysis.

1 Like

Narrowing the focus of the analysis

sonar.sources=./src/
sonar.inclusions=**/core/**
sonar.exclusions=**/external/**, **/tests/**

Running the analysis in parallel (Travis machines have two cores):

sonar.cfamily.threads=2

Caching of the sonar cache does not help (much), see this topic

Hi @David_Strelak,

what is the building time of your project on Travis?

sonar.cfamily.threads=2 might not help on travis as they are 2 vcpus (are they bursted?) and not 2 real cores, it might even slow down the analysis.

Hello Massimo,

we currently need between 5-17 minutes (depending on ccache hits) to build the project. Analysis takes additional half an hour, almost entirely on C++ code.
Regarding the cores, I don’t know if they are physical or virtual, but we got some speedup nonetheless.

They are virtual as they are provided by gce instances. Unfortunately at the moment I don’t have a better recommendation other than using something different than Travis (if you are on a public project). There are many alternatives, i.e. Azure DevOps, AppVeyor, Cirrus CI.