aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_HexParseTest.java
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2011-03-07 17:49:08 -0800
committerShawn O. Pearce <spearce@spearce.org>2011-03-07 18:23:39 -0800
commitf67e5602af72b7b2238eb6f6fcdc206a47edabd5 (patch)
tree78dc3735592a1665e05d60187c81351301ba67cb /org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_HexParseTest.java
parent1f57061684c83623d7d08be9044fc9cfd7b9fb54 (diff)
downloadjgit-f67e5602af72b7b2238eb6f6fcdc206a47edabd5.tar.gz
jgit-f67e5602af72b7b2238eb6f6fcdc206a47edabd5.zip
PackWriter: Reduce GC during enumeration
Instead of resizing an ArrayList until all objects have been added, append objects into a specialized List type that uses small arrays of 1024 entries for each 1024 objects added. For a large repository like linux-2.6, PackWriter will now allocate 1,758 smaller arrays to hold the object list, without creating any garbage from the intermediate states due to list expansion. 1024 was chosen as the block size (and initial directory size) as this is a reasonable balance for the PackWriter code. Each block uses approximately 4096 bytes in a 32 bit JVM, as does the default top level block directory. The top level directory doesn't expand until 1 million items have been added to the list, which for linux-2.6 won't yet occur as the lists are per-object-type and are thus bounded to about 1/3 of 1.8 million. Change-Id: If9e4092eb502394c5d3d044b58cf49952772f6d6 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RawParseUtils_HexParseTest.java')
0 files changed, 0 insertions, 0 deletions