Major allocation slowdown fix (ConfusionMatrix)