C++ PR analysis is not faster with server side cache

For C++, now we got a warning:
“sonar.cfamily.cache.enabled” and “sonar.cfamily.cache.path” properties are deprecated.
Visit the documentation page for more information about analysis cache configuration
C/C++/Objective-C | SonarCloud Docs

But the link does not say that the cache is no deprecated (I supposed it is linked)

Moreover, it does not seems faster :frowning:

Our projects are a mix of c# and C++, yesterday it took 9m47 for analysis, and today it takes 9m22 so the same time… both PR modify quite no file on the project…

Anyway, exclude does not seems to speed up the analysis, I still have some warning about excluded files in the analysis (there is a big old cs part that I exclude BUT still compile, it does not appear in Sonar but seems to be analyzed )
The analyse took less than 5 minutes before (when these cs projects were not included it the compilation) BUT takes now about 10 minutes… even with exclusion

Is it possible to optimize the analyze also on this (do not analyse exluded files!)

Hi @Laurent

I am sorry. The new C++ documentation was not deployed simultaneously with the analyzer, hence the discrepancy. It will be fixed as soon as possible.

“sonar.cfamily.cache.enabled” and “sonar.cfamily.cache.path” properties are deprecated because we renamed them. These names still work and the old C++ cache still works and it is NOT deprecated.

You cannot use both the old cache and the server-side cache simultaneously. If you want to try the server-side chase, you can remove these 2 properties.
Also, note that you might want to configure your pull requests analysis.

Let me know if it helps.


The SonarCloud C/C++/Objective-C analysis setup page has been updated and it is now in sync with the analyzer on SonarCloud.

You can have a closer look at the analysis cache section.

@Laurent Can you create a specific thread for the case of DotNet files being analyzed despite the fact that they are excluded from the scope of analysis to not mix up topics?

I take the opportunity of this message to also mention that Incremental Analysis on PR for DotNet (C#, VB.NET) is not yet activated on SonarCloud. This is the last language(s) still remaining to cover. It should come very soon in Q1 2023.

I do
Analyse with exlusion does not speed up the process - SonarCloud - Sonar Community (sonarsource.com)

I try to remove the local cache for C++ and it takes even longer:
INFO: Total time: 12:11.675s


@Laurent could you share the analysis log?
Please, make sure you add the “-X” when you run sonnar-scanner.

We can do that via PM if you prefer.

Seems to works now, with somr tocks on the old c# part it took only 3 minutes for a PR

1 Like