On Fri 8-Sep-06 4:11pm -0600, Bram Moolenaar wrote:

> Bill McCarthy wrote:
>
>> To better understand what vimdiff is doing (and why it is so
>> slow), I had my shell (4NT under WinXP) keep a log showing
>> me just what was requested. [Note: I use '>!' instead of '>'
>> for redirection because my 4NT is set to not overwrite
>> existing files unless explicitly told to do so.]
>> 
>> Invoking vimdiff with:  gvim -d file1 file2
>> 
>> I can see that the following 3 shell requests are made:
>> 
>>     diff -a VIo2A3F.tmp VIn2A40.tmp >!VId2A41.tmp
>>     diff -a --binary VIo2A3F.tmp VIn2A40.tmp >!VId2A41.tmp
>>     diff -a --binary VIo2A3F.tmp VIn2A40.tmp >!VId2A41.tmp
>> 
>> The log shows about 4 seconds between commands.
>> 
>> I would have thought that the first diff would provide
>> enough information.  What is the purpose of the other two?

> Vim first tests to see if executing diff works, with the -a and --binary
> arguments.  Finally it does the actual diff.
>
> This should take a fraction of a second.  4 seconds indicates that there
> is something wrong in your setup.  Perhaps caused by 4NT. Try using
> another shell.

Thank you for your comments.  I had added using Windows
"volatile environment variables" supported by 4nt.  The
author (Rex Conn of JPSoft) simply uses an API call to
implement these.  They are deadly slow and account for
nearly all of the time delay.

4nt, without that baggage, is still a fraction of a second
slower that cmd (which itself is about the same startup
speed of sh or zsh).

I am curious about the necessity of those 3 shell calls to
do a diff - maybe I'll spend a little time with diff.c next
weekend :-)

-- 
Best regards,
Bill

Reply via email to