About the performance when showing the history of the selected resource #243
Unanswered
fedejeanne
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am looking at the performance when displaying the Git History of the currently selected resource:
This is quite slow in our case since our product has a huge history (lots of commits) and it takes several seconds to calculate it. Looking at this VisualVM Sample: classWithMultipleCommits.zip
I can see that:
It all starts with the first call to
RevCommitList.fillTo(...)inside theGenerateHistoryJobWhen
TopoSortGeneratoris instantiated, the underlying generator (which is theRewriteGenerator) is queried for all of its commits. The JavaDoc even says that explicitly:jgit/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TopoSortGenerator.java
Lines 48 to 62 in 1ff3617
RewriteGenerator.applyFilterToParentsends up making lots of calls to theinclude(...)method. This is the filtering operation that gets me the commits of the current resourcejgit/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/PendingGenerator.java
Line 110 in 1ff3617
Questions
RewriteGeneratoreven needed? I don't quite get the reason from here:(this is the one that ends up being packed into the
RewriteGenerator)jgit/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java
Line 117 in 1ff3617
(and here is the
RewriteGeneratoritself)jgit/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java
Lines 128 to 130 in 1ff3617
Bonus
I also noticed that there is the notion of "pending" commits (look at
org.eclipse.jgit.revwalk.RevCommitList.isPending()andorg.eclipse.egit.ui.internal.history.GenerateHistoryJob.updateUI(boolean)) and there is the possibility to load commits lazily (which is what happens when I setup the Maximum number of commits to show underVersion Control (Team) > Git > Historyin the preferences)Preferences (Screenshot)
... but this only affects the way the commits are displayed in the commit list inside the
GitHistoryPage, whic happens after the commits have been queried and filtered, so it does not help performance. The real bottleneck is having to go through the whole list of commits and filter them the very first timeTopoSortGeneratoris instantiated.Beta Was this translation helpful? Give feedback.
All reactions