]> source.dussan.org Git - jgit.git/commit
Micro-optimize reuseDeltaFor in PackWriter 84/11684/1
authorShawn Pearce <spearce@spearce.org>
Fri, 5 Apr 2013 16:42:29 +0000 (09:42 -0700)
committerShawn Pearce <spearce@spearce.org>
Fri, 5 Apr 2013 16:43:02 +0000 (09:43 -0700)
commit01a0699acc09bc10646411bdd7cd1cf8004f7d65
treea74c4a8bcc3273a40bb1657d8c2f3cf78e7d4757
parent8e83c36e277aa79d4c06f4a30181b4457af21963
Micro-optimize reuseDeltaFor in PackWriter

This switch is called mostly for OBJ_TREE and OBJ_BLOB types, which
typically make up 66% of the objects in a repository. Simplify the
test for these common types by testing for the one bit they have in
common and returning early.

Object type 5 is currently undefined. In the old code it would hit
the default and return true. In the new code it will match the early
case and also return true. In either implementation 5 should never show
up as it is not a valid type known to Git.

Object type 6 OFS_DELTA is not permitted to be supplied here.
Object type 7 REF_DELTA is not permitted to be supplied here.

Change-Id: I0ede8acee928bb3e73c744450863942064864e9c
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java