SonarLint slows down Eclipse IDE startup

In my traces I see that SonarLint slows down the startup of the Eclipse IDE by more than 600 ms. It is on the top of my list of activators:

Activator times
351 org.sonarlint.eclipse.ui_4.3.0.12432
329 org.eclipse.egit.ui_5.7.0.202001151323-m1
300 org.sonarlint.eclipse.core_4.3.0.12432
266 org.eclipse.egit.core_5.7.0.202001151323-m1
233 org.eclipse.jdt.ui_3.21.0.v20200129-1023
232 org.eclipse.jdt.core_3.21.0.v20200126-2056
140 org.eclipse.core.resources_3.13.700.v20200123-2308
126 org.eclipse.ui.trace_1.1.800.v20200106-1301
124 org.eclipse.core.runtime_3.17.100.v20200114-1847
87 org.eclipse.ui.workbench_3.118.0.v20200128-1950
75 org.eclipse.core.contenttype_3.7.600.v20200124-1609

See https://www.vogella.com/tutorials/EclipsePerformance/article.html#using-the-build-in-tracing-facilities-of-eclipse how to trace this yourself.

Most likely you are doing lots of things in your activator. Could you move that initialization to an OSGi service or do it lazy?

Best regards, Lars

1 Like

Hi @vogella

Thanks for the feedback. I created a ticket that we will try to fix during the next sprint:
https://jira.sonarsource.com/browse/SLE-337

Thanks. Looking forward for this. Lets me know if you need input. For inspiration, see https://github.com/eclipse/dartboard/issues/114 and https://github.com/eclipse/dartboard/commit/39b6e6f7c2ff7a2ac2ab7f27679c199894c02531 where we move to use OSGI services for Dartboard.

The OSGi annotations requires to activate “Generate descriptors from annotated source” in the preference under Plug-in Development -> DS Annotations.

1 Like

Hi @vogella

I have fixed the issue in SonarLint master (it should be released next week). Feel free to test using this artifact:
https://repox.jfrog.io/repox/sonarsource/org/sonarsource/sonarlint/eclipse/org.sonarlint.eclipse.site/4.4.0.14954/org.sonarlint.eclipse.site-4.4.0.14954.zip

Note that I have not used OSGi services, because I have not found a way to properly react to “close” events to cleanup listeners. So I’m still relying on plugin activator, but moved slow startup code to a separate job (I found several plugins doing the same).

1 Like

Looks awesome, here are my new times:

27 org.sonarlint.eclipse.ui_4.4.0.14954
9 org.sonarlint.eclipse.core_4.4.0.14954

Thanks Julien from ~650 ms to ~40 ms is awesome

5 Likes

When is this change available via the public update site?

It already is, SonarLint for Eclipse 5.0 was deployed last week (2020-02-18) to the public release update site.

Thank you.

The version number listed on https://www.sonarlint.org/eclipse/ says 4.3, updated Nov 2019. Was the site text just not updated?

Indeed, the product Web site is not up-to-date (yet).

But the version it links to is correct? It’s just a text problem?

Yup, this is only an issue with the text of the link: it points to the Eclipse Marketplace which holds the latest version, regardless of the version displayed on the site.

The link you posted is 404, already by this morning.
Should be SonarLint | Eclipse Plugins, Bundles and Products - Eclipse Marketplace | Eclipse Foundation instead ?

To be completely accurate, the URL I posted is the one that shall be used in the Eclipse update site management window - it returns a 404 when called by a browser because there is no index.html, however it does contain a compositeContent.xml file as expected by the Eclipse P2 client.

Ok, thanks for clarification.