Re: Vimdiff Oddity

2006-09-10 Thread Bill McCarthy
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



Re: Vimdiff Oddity

2006-09-08 Thread Bram Moolenaar

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.

-- 
ARTHUR:  Bloody peasant!
DENNIS:  Oh, what a give away.  Did you here that, did you here that, eh?
 That's what I'm on about -- did you see him repressing me, you saw it
 didn't you?
  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Vimdiff Oddity

2006-09-07 Thread Bill McCarthy
Hello Vim Developers,

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?

-- 
Best regards,
Bill



Re: Vimdiff Oddity

2006-09-07 Thread A.J.Mechelynck

Bill McCarthy wrote:

Hello Vim Developers,

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?



Just guessing.

As noted in the help (e.g. under :help 'diffexpr'), vimdiff uses 
ed-style diffs, which (unlike context or unified diffs) are not 
reversible. It may need those three calls to properly highlight both 
windows of the vimdiff. The fact that the temporary files' _names_ are 
the same between calls doesn't prove that their _contents_ are the same.


Or you may have a nonstandard diff.exe: the --help for my GNU diff 
(version 2.8.7) makes no mention of a --binary argument.



Best regards,
Tony.