SonarCloud on Travis speed-up tips


(David Střelák) #1

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.

(David Střelák) #2

Narrowing the focus of the analysis

sonar.exclusions=**/external/**, **/tests/**

(David Střelák) #3

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


(David Střelák) #4

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

(Massimo Paladin) #5

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.

(David Střelák) #6

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.

(Massimo Paladin) #7

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.