Performance improvement for large-scale diff