Improve efficiency of diffing algorithms