Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Jgit diff is slow as compared to git diff commandline(Jgit diff is slow as compared to git diff commandline)
Jgit diff is slow as compared to git diff commandline [message #1841580] Fri, 21 May 2021 07:33 Go to next message
Pallavi Agarwal is currently offline Pallavi AgarwalFriend
Messages: 5
Registered: May 2021
Junior Member
We are using jgit to compute diff between two commits of a given repo using DiffFormatter, the code looks like below
diffFormatter.scan(parentCommit?.tree, childCommit.tree)



where parentCommit and childCommit are two RevCommit objects.

We noticed that if a commit is big or contains pdf file or for some binary file changes.

We have set timeout of 1minute, which is quite big time for git diff operation and timing out on this looks some bug.
Re: Jgit diff is slow as compared to git diff commandline [message #1841611 is a reply to message #1841580] Sat, 22 May 2021 07:51 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 406
Registered: August 2016
Senior Member
Might perhaps be the rename detection. There was a change in JGit enabling switching rename detection (based on content similarity) off for files larger than a certain threshold (by default 50Mb), and there is a pending change for switching it off for binary files.
Re: Jgit diff is slow as compared to git diff commandline [message #1841632 is a reply to message #1841611] Mon, 24 May 2021 04:36 Go to previous messageGo to next message
Pallavi Agarwal is currently offline Pallavi AgarwalFriend
Messages: 5
Registered: May 2021
Junior Member
I see the time is also taken by jgit diff ` git.diff().setOldTree(getCanonicalTreeParser(repository, parentCommit!!))
.setNewTree(getCanonicalTreeParser(repository, childCommit))
.call()`

Also the formatting take huge time where the commit is deletion of many files.
Re: Jgit diff is slow as compared to git diff commandline [message #1841633 is a reply to message #1841632] Mon, 24 May 2021 04:39 Go to previous message
Pallavi Agarwal is currently offline Pallavi AgarwalFriend
Messages: 5
Registered: May 2021
Junior Member
I am trying to set notTreeFilter in Path Filter and looks like some bug there. It is ignoring all java files in a commit when I simply do
` .setPathFilter(PathSuffixFilter.create(".txt").negate())
`
I want to include all files which are not txt file in commit.
Previous Topic:Context menu on repository is missing entries
Next Topic:IDz Version: 14.0.0.9, Build id: idz14009O-I20191015_1437 shouldn't include EGit
Goto Forum:
  


Current Time: Wed Oct 27 20:40:04 GMT 2021

Powered by FUDForum. Page generated in 0.02379 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top