Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] jgit-timestamp-provider performance


On Jan 30, 2019, at 16:05, Michael Keppler <michael.keppler@xxxxxx> wrote:

Hi friends,

I recently profiled a huge maven build in our company and noticed that the jgit-timestamp-provider used in tycho often takes between 3 and 7 seconds per module on our fast build servers. For small modules that can sometimes be the majority of the build time and sum up to several minutes in an aggregator! The time is spent in revwalk.next(), as to be expected.

Does anyone of you see some potential for optimization of the revwalk, e.g. by means of additional filters or similar? Code can be seen at https://github.com/eclipse/tycho.extras/blob/master/tycho-buildtimestamp-jgit/src/main/java/org/eclipse/tycho/extras/buildtimestamp/jgit/JGitBuildTimestampProvider.java#L166

If not, is there anything I can do outside of tycho? E.g. might checking out a shallow copy only or garbage collecting the repository before the build make a difference for that kind of revwalk?

Add between lines 171 and 172

  walk.setRewriteParents(false);

You don't need parent rewriting if you're only interested in the last commit that touched a file.


This should bring a significant speed-up.

If still not good enough, take a look at org.eclipse.jgit.treewalk.filter.PathFilterGroup.Single. The
might perhaps benefit from a similar mechanism (throwing StopWalkException.INSTANCE)
to stop the tree walk as soon as possible.

Cheers,

  Thomas

Back to the top