Create a faster, specialized map for ObjectId subclasses
commit88b5ee9dc62cf858bfaa8a8c935ecb69242289f6
authorShawn O. Pearce <spearce@spearce.org>
Thu, 20 Mar 2008 23:44:06 +0000 (20 19:44 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 7 Apr 2008 05:02:41 +0000 (7 01:02 -0400)
tree33b2aa08fa84371d172ecc0ec0a362012231f0c1
parentefad633c64cacdf0e3f9576346417863469e221c
Create a faster, specialized map for ObjectId subclasses

Now that RevObject is a subclass of ObjectId we can further reduce the
memory usage within RevWalk as well as boost runtime performance by
using a highly specialized hash that takes advantage of direct access
to the members of the ObjectId.

Between this specialized hash and the commits prior to it we shave
nearly 200 ms (32%) off the running time for "rev-list --parents HEAD"
on a relatively recent git.git repository (12,966 commits).  This puts
us within 85% of the performance of Cygwin C Git.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit/src/org/spearce/jgit/lib/ObjectIdSubclassMap.java [new file with mode: 0644]
org.spearce.jgit/src/org/spearce/jgit/revwalk/RevWalk.java