Uploaded image for project: 'SonarLint For Eclipse'
  1. SonarLint For Eclipse
  2. SLE-41

Performance issue when developing Eclipse plugins

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None

      Description

      Working on some projects lead to bad performance of the Java analyzer.

      The thread dump seem to show that there is a bottleneck on:

      "SonarLint analysis" daemon prio=6 tid=0x000000000e108000 nid=0x1688 runnable [0x000000001fdae000]
         java.lang.Thread.State: RUNNABLE
          at java.io.WinNTFileSystem.getBooleanAttributes(Native Method)
          at java.io.File.isDirectory(File.java:843)
          at org.apache.commons.io.filefilter.DirectoryFileFilter.accept(DirectoryFileFilter.java:70)
          at org.apache.commons.io.filefilter.AndFileFilter.accept(AndFileFilter.java:122)
          at org.apache.commons.io.filefilter.OrFileFilter.accept(OrFileFilter.java:118)
          at java.io.File.listFiles(File.java:1285)
          at org.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:478)
          at org.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
          at org.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
          at org.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
          at org.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
          at org.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
          at org.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
          at org.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
          at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:528)
          at org.sonar.java.AbstractJavaClasspath.getMatchingFiles(AbstractJavaClasspath.java:133)
          at org.sonar.java.AbstractJavaClasspath.getFilesForPattern(AbstractJavaClasspath.java:120)
          at org.sonar.java.AbstractJavaClasspath.getFilesFromProperty(AbstractJavaClasspath.java:84)
          at org.sonar.java.JavaClasspath.init(JavaClasspath.java:49)
          at org.sonar.java.AbstractJavaClasspath.getElements(AbstractJavaClasspath.java:170)
          at org.sonar.java.SonarComponents.getJavaClasspath(SonarComponents.java:131)
          at org.sonar.java.JavaSquid.<init>(JavaSquid.java:83)
          at org.sonar.plugins.java.JavaSquidSensor.analyse(JavaSquidSensor.java:89)
          at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:54)
          at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:47)
          at org.sonarsource.sonarlint.core.analyzer.sensor.PhaseExecutor.execute(PhaseExecutor.java:45)
          at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:134)
          at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:128)
          at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:113)
          at org.sonarsource.sonarlint.core.container.global.GlobalContainer.analyze(GlobalContainer.java:102)
          at org.sonarsource.sonarlint.core.SonarLintClientImpl.analyze(SonarLintClientImpl.java:85)
          at org.sonarlint.eclipse.core.internal.jobs.SonarLintClientFacade.startAnalysis
      

      This is probably due to classpath loading that is done for every analysis. The strange thing is that it works fine for many projects but seems to affect Eclipse plugin projects even if the number of JAR in the classpath is low. There are probably some very huge JARs.

      Example classpath:

      sonar.java.libraries=
      [jdk7]\jre\lib\resources.jar
      [jdk7]\jre\lib\rt.jar
      [jdk7]\jre\lib\jsse.jar
      [jdk7]\jre\lib\jce.jar
      [jdk7]\jre\lib\charsets.jar
      [jdk7]\jre\lib\jfr.jar
      [jdk7]\jre\lib\ext\access-bridge-64.jar
      [jdk7]\jre\lib\ext\dnsns.jar
      [jdk7]\jre\lib\ext\jaccess.jar
      [jdk7]\jre\lib\ext\localedata.jar
      [jdk7]\jre\lib\ext\sunec.jar
      [jdk7]\jre\lib\ext\sunjce_provider.jar
      [jdk7]\jre\lib\ext\sunmscapi.jar
      [jdk7]\jre\lib\ext\zipfs.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.ui_3.105.0.v20130522-1122.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.swt_3.102.1.v20140206-1334.jar
      [EclipseKeplerSR2]\plugins\com.ibm.etools.webedit.xulrunner.fragment_1.0.0.v20140311_2325.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.swt.win32.win32.x86_64_3.102.1.v20140206-1358.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.jface_3.9.1.v20130725-1141.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.core.commands_3.6.100.v20130515-1857.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.ui.workbench_3.105.2.v20140211-1711.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.e4.ui.workbench3_0.12.0.v20130515-1857.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.core.runtime_3.9.100.v20131218-1515.jar
      [EclipseKeplerSR2]\plugins\javax.annotation_1.1.0.v201209060031.jar
      [EclipseKeplerSR2]\plugins\javax.inject_1.0.0.v20091030.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.osgi_3.9.1.v20140110-1610.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.equinox.weaving.hook_1.0.200.I20130319-1000.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.equinox.common_3.6.200.v20130402-1505.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.core.jobs_3.5.300.v20130429-1813.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.core.runtime.compatibility.registry_3.5.200.v20130514-1256\runtime_registry_compatibility.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.equinox.registry_3.5.301.v20130717-1549.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.equinox.preferences_3.5.100.v20130422-1538.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.core.contenttype_3.4.200.v20130326-1255.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.equinox.app_1.3.100.v20130327-1442.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.core.resources_3.8.101.v20130717-0806.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.core.net_1.2.200.v20130430-1352.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.debug.core_3.8.0.v20130514-0954.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.core.variables_3.2.700.v20130402-1741.jar
      [EclipseKeplerSR2]\plugins\org.jdom_1.1.1.v201101151400.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.jdt.core_3.9.50.v20140317-1741.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.jdt.compiler.apt_1.0.650.v20140316-1836.jar
      [EclipseKeplerSR2]\plugins\org.eclipse.jdt.compiler.tool_1.0.250.v20140316-1836.jar
      [EclipseKeplerSR2]\plugins\org.apache.commons.io_2.0.1.v201105210651.jar
      [EclipseKeplerSR2]\plugins\org.apache.commons.lang_2.6.0.v201205030909.jar
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julien.henry Julien Henry
                Reporter:
                julien.henry Julien Henry
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: