Hi all, In Differ, merged diffs are repeatedly calculated whenever we iterate over changes. The merged versions of diffs can theoretically differ, as the underlying text is passed in on each call. However, this text always ends up being the raw file text, and we always update our diffs whenever this text changes. As such, we can cache the merged version of our diffs by disallowing the effectively unused texts argument. I'm attaching two patches, the first of which implements this caching of merged diffs, and the second of which provides a short-circuit for two-way comparisons. On two-way diffs, these patches provide a very slight speed improvement; on three-way diffs, the speed-up is easily measurable -- around 5% in a few quick tests based on scrolling through a three-way source file comparison. Comments appreciated. cheers, Kai
Attachment:
0001-Cache-merged-diffs-by-disallowing-arbitrary-text-seq.patch
Description: Binary data
Attachment:
0002-Don-t-merge-diffs-for-two-way-comparisons.patch
Description: Binary data