[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] ObjectDirectory.scanPacksImpl performance regression and temporary memory leak

With commits 82b1af31 and fef78212, the reuse condition of existing PackFiles in ObjectDirectory.scanPacksImpl has been changed from:

if (oldPack != null) {
	list.add(oldPack);
	continue;
}

to:

if (oldPack != null
    && !oldPack.getFileSnapshot().isModified(packFile)) {
	list.add(oldPack);
	continue;
}

Due to the racy-clean handling in FileSnapshot.isModified, this results in many false-positive modification detections immediately after creating or modifying a PackFile and thus in redundant re-creation of PackFiles. I'm experiencing our unit tests to be ~5x slower with this change.

Also, the oldPack may now be removed from "forReuse" and thus not properly closed anymore further down the loop.

-Marc