0

I've recently upgraded our SonarQube instance to 5.1.2. We use the SVN plugin (v1.1) for SCM analysis. Since the upgrade, the performance of this plugin has been extremely slow.

To reproduce the problem, I analyzed a project on my own PC against 2 installations of SonarQube (also installed on my PC - 4.4.1 and 5.1.2).

The SCM analysis on 4.4.1 took 45 seconds, while the 5.1.2 version took almost 1.5 hours.

Below are sample snippets from the log files. The 4.4.1 version doesn't indicate the number of files analyzed, but it was same as 5.1.2 analysis (it's the same project).

Version 4.4.1:

[INFO] [17:53:21.914] Sensor ScmActivitySensor...
[INFO] [17:53:21.914] Trying to guess scm provider from project layout...
[INFO] [17:53:21.915] Found SCM type: svn
[INFO] [17:53:21.915] Retrieve SCM blame information with encoding windows-1252...
...
[INFO] [17:54:06.488] Retrieve SCM blame information with encoding windows-1252 done: 44573 ms
[INFO] [17:54:06.488] Sensor ScmActivitySensor done: 44574 ms

Version 5.1.2:

[INFO] [18:00:54.971] Sensor SCM Sensor
[INFO] [18:00:54.987] SCM provider for this project is: svn
[INFO] [18:00:54.991] 1645 files to be analyzed
...
[INFO] [19:27:16.017] 1645/1645 files analyzed
[INFO] [19:27:16.017] Sensor SCM Sensor (done) | time=5181046ms

This seems to rule out our SVN server or the machine that performs the analysis as the problem. I'm not sure where to look next? Can anyone help?

I can provide full logs if required (although debug output in 5.1.2 didn't seem to show anything extra that was helpful).

Tim Webster
  • 684
  • 8
  • 18
  • I am able to answer this myself. It is because the call to SVNLogClient.doAnnotate() sets the 'includeMergedRevisions' flag to true. Whether this should be set for us or if it should be configurable is another story as it does include useful functionality. Either way, setting it to false speeds it up enormously as one would expect. – Tim Webster Aug 26 '15 at 15:23

1 Answers1

0

As I mentioned in the comment, the reason for this is because merge history is included in the SVN blame.

If you stick it out and wait for one analysis to go though, the subsequent ones will be much faster as blame operations are only performed on changed files.

Tim Webster
  • 684
  • 8
  • 18