Browse Source
As it turns out, every single diff algorithm we might try to implement can benfit from using the SequenceComparator's native concept of the simple reduceCommonStartEnd() step. For most inputs, there can be a significant number of elements that can be removed from the space the DiffAlgorithm needs to consider, which will reduce the overall running time for the final solution. Pool this logic inside of DiffAlgorithm itself as a default, but permit a specific algorithm to override it when necessary. Convert MyersDiff to use this reduction to reduce the space it needs to search, making it perform slightly better on common inputs. Change-Id: I14004d771117e4a4ab2a02cace8deaeda9814bc1 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>stable-0.10
Shawn O. Pearce
14 years ago
4 changed files with 122 additions and 100 deletions
Loading…
Reference in new issue