would it make sense to use null instead to save a couple of 40 byte SHA1 objects in memory (with large repos you'll create many ThreeWayDiffEntries). I analyzed a heap dump taken after running the example you described. I found that the ThreeWayDiffEntries weigh around 500 byte, many seem to have only one ID really set and two set to A_ZERO which eats 80 byte for every entry.