A while back we finally switched from SVN to Git.
In doing so, I forgot to replace the SVN plugin by the Git plugin in SonarQube though.
So since then, the VCS integration was not used and the analysis builds needed around 2 hours with a resourcs graph like this:
Now with upgrading SonarQube from 6.5 to 7.5 I of course also added the Git plugin.
Unfortunately now the builds need around 24 - 30 hours (yes, about a day, this is not a typo) with a resource graph like this:
After some analysis, I found out that the problem is the Git analysis which took up 21.5 hours of the 23.5 hours the build in the second screenshot needed.
As an experiment I took the Git SCM plugin code from tag 1.7.0 and replaced all usage of JGit by native Git commands and rerun an analysis and now we are back to the old duration around 2 hours and a sensible resources graph like this:
So here some advantages of using native Git executable instead of JGit:
- It is much more CPU friendly
- It is much more RAM friendly
- It fully supports Git (JGit will probably need another 5 years to add worktree or .mailmap support)
- Probably other points I don’t think of currently
Is there any chance you will use native Git instead of JGit in the future, or accept a PR that changes this?
An implementation could also determine whether native Git is accessible and use JGit as a fallback if that would be preferred.
Actually most work would already be finished, as the only thing that was added in
master since 1.7.0 was the
IgnoreCommand, everything else more or less stayed the same.
PS: the current state of the git plugin on GitHub is not buildable as the dependency on the plugin API is not published. :-/