[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: diff_file_diff3 spins

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-04-25 16:28:27 CEST

Chia-liang Kao <clkao@clkao.org> writes:

> Chia-liang Kao <clkao <at> clkao.org> writes:
>> Doing merge on with the following files:
>>
>> $ ab -clkao- [~] wc /tmp/bad-*
>> 0 0 0 /tmp/bad-empty.csv
>> 62946 62946 880992 /tmp/bad-local.csv
>> 68633 68633 1029132 /tmp/bad-new.csv
>> 131579 131579 1910124 total
>>
>> causes diff_file_diff3 to spin.
>
> Actually it finishes after 3 minutes:
>
> $ ab -clkao- [/tmp/diff_file_diff3] time perl diff.t
> _p_svn_diff_t=SCALAR(0x804d23c) at diff.t line 4.
> 158.366u 1.264s 3:00.50 88.4% 10+16118k 0+0io 0pf+0w
>
> But with /usr/bin/diff3:
>
> $ ab -clkao- [/tmp/diff_file_diff3] time diff3 bad-empty.csv bad-local.csv
> bad-new.csv > /dev/null
> 0.455u 0.055s 0:00.64 78.1% 48+9124k 0+0io 0pf+0w

This is likely to be because GNU diff uses a number of heuristics to
shortcut the full diff algorithm and Subversion's diff implementation
doesn't do this. Without the heuristics GNU diff is likely to take
much longer. diff3 doesn't appear to allow one to disable the
heuristics but diff has the --minimal switch, try

$ diff --minimal bad-local.csv bad-new.csv
$ diff bad-local.csv bad-new.csv

to confirm that the heuristics make the difference.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Apr 25 16:29:28 2005

This is an archived mail posted to the Subversion Dev mailing list.