Performance improvements to diff algorithms