Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarLint is super slow

I'm using the new eclipse plugin SonarLint in a large Eclipse RCP project. It is extremely slow. Analyzing all plugin projects (over 310) lasts several hours. SonarLint creates a log for every project build, that looks like this:

Starting SonarLint
...
Load global repositories (done from cache) | time=98ms
...
Load plugins index (done from cache) | time=3ms
...
Load project repositories (done) | time=3ms
...
Load quality profiles (done from cache) | time=45ms
...
Load active rules (done) | time=174ms
...
Load server rules (done from cache) | time=13ms
...
JavaClasspath initialization done: 74003 ms
...

As we can see, most of the time we are waiting for the java classpath initialization. It's getting even worse: This initialization is done after every save of one single java file!

Is there any way to speed this process up?

like image 253
Adam Taras Avatar asked Jan 25 '16 12:01

Adam Taras


1 Answers

Removing the SonarLint for Eclipse Java Configuration Helper is not a solution: it will remove the integration of SonarLint with Java projects, meaning that the analysis won't have several important properties needed to make it accurate, such as the classpath.

You might be experiencing this problem: https://jira.sonarsource.com/browse/SONARJAVA-1818.

Here are some things to try if SonarLint is running slow:

  • Make sure you are using the Java analyzer 4.2, which is included in SonarLint Eclipse > 2.2.1 (if using the connected mode, install it in the SonarQube server).
  • Upgrade to latest release of SonarLint (improvements are always being made)
  • Increase the heap space used by Eclipse.

If you still face performance problems, please let us know how you are using SonarLint so that we track down the problem. You can a open a topic in the SonarLint group.

like image 159
Duarte Meneses Avatar answered Oct 12 '22 01:10

Duarte Meneses