[issue6931] dreadful performance in difflib: ndiff and HtmlDiff

Charles-Francois Natali report at bugs.python.org
Sun Apr 4 18:59:21 CEST 2010


Charles-Francois Natali <neologix at free.fr> added the comment:

This is because difflib.ndiff (called by difflib.HtmlDiff.make_table), contrarily to difflib.unified_diff (and probably kdiff3), doesn't restrict itself to contiguous lines, and searches diff even inside lines, so the complexity is much worse (see how many times _fancy_replace and quick_ratio are being called).
It might be a good idea to allow the user to specify the type of diff needed (ndiff vs unified_diff).

----------
nosy: +neologix

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6931>
_______________________________________


More information about the Python-bugs-list mailing list