]> source.dussan.org Git - jgit.git/commit
RevWalk: Don't reset ObjectReader when stopping 33/2433/4
authorShawn O. Pearce <spearce@spearce.org>
Sun, 6 Feb 2011 09:15:33 +0000 (01:15 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 13 Feb 2011 21:43:11 +0000 (13:43 -0800)
commitbc1af8459e048ff7a1c25ec6614c6a35520158b8
tree17125bc3bbfc6f6c018629f5ff2b656b658180a0
parent5664fb3bfb63e4db49dc07d13ace419e810186c2
RevWalk: Don't reset ObjectReader when stopping

Applications like UploadPack reset() and reuse the same RevWalk
multiple times in very rapid succession.  Releasing the ObjectReader's
internal state on each use, only to allocate it again on the next
cycle kills performance if the ObjectReader has internal caches, or
even if the Inflater gets returned and pulled from the InflaterCache
too frequently.

Making releasing the ObjectReader the application's responsibility
when it is done with the RevWalk, which most already do by wrapping
their loop in a try/finally block.

Change-Id: I3ad188a719e8d7f6bf27d1a7ca16d465534713f4
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/PendingGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java