summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYunjie Li <yunjieli@google.com>2020-04-23 15:11:14 -0700
committerYunjie Li <yunjieli@google.com>2020-05-12 17:32:15 -0700
commite250482c7af5e1750b241683a1afde35ed020fee (patch)
treef855681eb6282277ca357cc50ea8c9a9b1f5f50e
parentdcb02654360e7617380361a3b755dc380c239edf (diff)
downloadjgit-e250482c7af5e1750b241683a1afde35ed020fee.tar.gz
jgit-e250482c7af5e1750b241683a1afde35ed020fee.zip
PackBitmapIndex: Remove convertedBitmaps in the Remapper
The convertedBitmaps serves for time-optimization purpose. But it's actually not saving time much but using lots of memory. So remove the field here to save memory. Currently the remapper class is only used in the construction of the bitmap index file. And during the preparation of the file, we're only getting bitmaps from the remapper when finding objects accessible from a commit, so bitmap associated with each commit will only be fetched once and thus the convertedBitmaps would hardly be read, which means that it's not saving time. Change-Id: Ic942a8e485135fb177ec21d09282d08ca6646fdb Signed-off-by: Yunjie Li <yunjieli@google.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java10
1 files changed, 0 insertions, 10 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java
index 273eeef7e5..4b25284517 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java
@@ -18,7 +18,6 @@ import org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.StoredBitmap;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.BitmapIndex;
import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.ObjectIdOwnerMap;
import com.googlecode.javaewah.EWAHCompressedBitmap;
import com.googlecode.javaewah.IntIterator;
@@ -34,7 +33,6 @@ public class PackBitmapIndexRemapper extends PackBitmapIndex
private final BasePackBitmapIndex oldPackIndex;
final PackBitmapIndex newPackIndex;
- private final ObjectIdOwnerMap<StoredBitmap> convertedBitmaps;
private final BitSet inflated;
private final int[] prevToNewMapping;
@@ -65,7 +63,6 @@ public class PackBitmapIndexRemapper extends PackBitmapIndex
private PackBitmapIndexRemapper(PackBitmapIndex newPackIndex) {
this.oldPackIndex = null;
this.newPackIndex = newPackIndex;
- this.convertedBitmaps = null;
this.inflated = null;
this.prevToNewMapping = null;
}
@@ -74,7 +71,6 @@ public class PackBitmapIndexRemapper extends PackBitmapIndex
BasePackBitmapIndex oldPackIndex, PackBitmapIndex newPackIndex) {
this.oldPackIndex = oldPackIndex;
this.newPackIndex = newPackIndex;
- convertedBitmaps = new ObjectIdOwnerMap<>();
inflated = new BitSet(newPackIndex.getObjectCount());
prevToNewMapping = new int[oldPackIndex.getObjectCount()];
@@ -152,10 +148,6 @@ public class PackBitmapIndexRemapper extends PackBitmapIndex
if (bitmap != null || oldPackIndex == null)
return bitmap;
- StoredBitmap stored = convertedBitmaps.get(objectId);
- if (stored != null)
- return stored.getBitmap();
-
StoredBitmap oldBitmap = oldPackIndex.getBitmaps().get(objectId);
if (oldBitmap == null)
return null;
@@ -168,8 +160,6 @@ public class PackBitmapIndexRemapper extends PackBitmapIndex
inflated.set(prevToNewMapping[i.next()]);
bitmap = inflated.toEWAHCompressedBitmap();
bitmap.trim();
- convertedBitmaps.add(
- new StoredBitmap(objectId, bitmap, null, oldBitmap.getFlags()));
return bitmap;
}