]> source.dussan.org Git - jgit.git/commit
Optimize DFS object reuse selection code 55/11655/4
authorShawn Pearce <spearce@spearce.org>
Thu, 4 Apr 2013 19:18:22 +0000 (12:18 -0700)
committerShawn Pearce <spearce@spearce.org>
Thu, 4 Apr 2013 21:21:34 +0000 (14:21 -0700)
commitd72416afbb1736d537197c68462a574e86155cbe
tree29dc9d919f504e276961c0b67ad16b44f694fc56
parent93a27ce7287c5574bcf1ed872e8964314fc8818b
Optimize DFS object reuse selection code

Rewrite this complicated logic to examine each pack file exactly
once. This reduces thrashing when there are many large pack files
present and the reader needs to locate each object's header.

The intermediate temporary list is now smaller, it is bounded to
the same length as the input object list. In the prior version of
this code the list contained one entry for every representation of
every object being packed.

Only one representation object is allocated, reducing the overall
memory footprint to be approximately one reference per object found
in the current pack file (the pointer in the BlockList). This saves
considerable working set memory compared to the prior version that
made and held onto a new representation for every ObjectToPack.

Change-Id: I2c1f18cd6755643ac4c2cf1f23b5464ca9d91b22
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjectRepresentation.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjectToPack.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/LargePackedWholeObject.java