Browse Source

ObjectIdSubclassMap: Change initial size to 2048

32 is way to small for the map. Most applications using the map
will need to load more than 16 objects just from the root refs
being read from the Repository.

Default the initial size to 2048. This cuts out 6 expansions in
the early life of the table, reducing garbage and rehashing time.

Change-Id: I6dd076ebc0b284f1755855d383b79535604ac547
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
stable-0.12
Shawn O. Pearce 14 years ago
parent
commit
16350bf9e4
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java

2
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java

@ -63,7 +63,7 @@ import java.util.NoSuchElementException;
* type of subclass of ObjectId that will be stored in the map. * type of subclass of ObjectId that will be stored in the map.
*/ */
public class ObjectIdSubclassMap<V extends ObjectId> implements Iterable<V> { public class ObjectIdSubclassMap<V extends ObjectId> implements Iterable<V> {
private static final int INITIAL_TABLE_SIZE = 32; private static final int INITIAL_TABLE_SIZE = 2048;
private int size; private int size;

Loading…
Cancel
Save