2008/5/21 David Roundy <[EMAIL PROTECTED]>: >If you're interested in improving the diff code even more, I think it'd be >worth trying to implement the "patience diff" algorithm from bazaar, which >is most likely simpler, and probably produces nicer diffs.
Yes, patience looks relatively straightforward. I'll have a peek on it... > Oh, and another interesting (related) idea would be to specialize the code > for doing a character-based diff rather than a line-based diff. This would > require a bit of tedious work, but should be simpler in many ways (e.g. no > need to hash the single bytes). > > getByteChanges :: PackedString -> PackedString > -> [(Int,PackedString,PackedString)] > > In principle this could share a lot of code with getChanges, but in > practice the optimal code will be quite different between the two, since > there are unlikely to be any unique characters. And also because there's > no reason to hash the bytes. I've refactored the cmpseq, findDiag and friends to use an input function cmp :: Int -> Int -> Bool and an output function output :: Int -> Int -> Int -> Int -> ST s Int In principle the improved cmpseq could be used by the binary diff function. Performance seems to be at par with the current implementation. I'll do some code cleanup and profiling before submitting the patch (I guess it won't make to 2.0.1 ;). -- Pekka.Pessi mail at nokia.com _______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
