This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author heidar.rafn
Recipients heidar.rafn
Date 2009-09-17.14:54:56
SpamBayes Score 1.8196195e-07
Marked as misclassified No
Message-id <1253199298.69.0.280559653373.issue6931@psf.upfronthosting.co.za>
In-reply-to
Content
Relatively small set of lines with differences in most lines can destroy
the performance of difflib.HtmlDiff.make_table and difflib.ndiff.
I am using it like this:
    ...
    htmldiffer = HtmlDiff()
    return htmldiffer.make_table(src_lines, dst_lines, 
        fromdesc="file1",
        todesc="file2",
        context=True)

I have written the src_lines and dst_lins to files and tried this with
the Tools/scripts/diff.py wrapper with same results when using the
switches -m or -n.
The performance is fine when using difflib.unified_diff or switch -u on
diff.py

Attached are files that show this clearly.
left200.txt,right200.txt - 200 lines of text - duration 11 seconds.
left500.txt,right500.txt - 500 lines of text - duration 2min 58 sec
left1000.txt,right1000.txt - 1000 lines of text - duration 29min 4sec

tested on Intel dualcore T2500 2GHz with 2 GB of memory, python 2.5.2 on
Ubuntu. Same problom on python 2.6 on Fedora-11
For reference, the kdiff3 utility performs beautifully on these files.
History
Date User Action Args
2009-09-17 14:54:58heidar.rafnsetrecipients: + heidar.rafn
2009-09-17 14:54:58heidar.rafnsetmessageid: <1253199298.69.0.280559653373.issue6931@psf.upfronthosting.co.za>
2009-09-17 14:54:57heidar.rafnlinkissue6931 messages
2009-09-17 14:54:56heidar.rafncreate