]> source.dussan.org Git - jgit.git/commit
Avoid expensive getAllRefsByPeeledObjectId() in PlotWalk constructor 09/124609/1
authorThomas Wolf <thomas.wolf@paranor.ch>
Fri, 15 Jun 2018 14:01:58 +0000 (16:01 +0200)
committerThomas Wolf <thomas.wolf@paranor.ch>
Fri, 15 Jun 2018 14:11:10 +0000 (16:11 +0200)
commit2e76daec146cdba5d8db44f3fbc81472773232fd
tree9bc04b1787cdaae8cee1cb53af933d34db9d2fdf
parentb92136f023b992b4f6c28b183d094d1fd30fd8f8
Avoid expensive getAllRefsByPeeledObjectId() in PlotWalk constructor

Instead, do it when we return the first PlotCommit from next().
On a repository with many refs, getAllRefsByPeeledObjectId() can
take a while. Doing a late initialization simplifies the handling
of a PlotWalk.

EGit, for instance, creates and configures an instance, and then
does the real walk in a background job. With late initialization,
the potentially expensive getAllRefsByPeeledObjectId() also occurs
in that background job.

Bug: 485743
Change-Id: I84c020cf8f7afda6f181778786612b8e6ddd7ed8
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java