reducing file I/O during a file edit

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

reducing file I/O during a file edit

Marc MERLIN-2
I'm using vim over a slow NFS connection (transatlantic)
Yes, you can make fun of me, but when you're done laughing, can you help me
out with this:

Each cursor reposition causes this file I/O":
open(".", O_RDONLY|O_LARGEFILE)         = 4
fchdir(4)                               = 0
chdir("var/lib/getupdates")             = 0
getcwd("/home/merlin/mydir/files/var/lib/getupdates", 1024) = 59
fchdir(4)                               = 0
close(4)                                = 0
getcwd("/home/merlin/mydir/files", 1024) = 40

As far as I can tell, it's vim 'did this file get changed from under me'
support, and I'd love to turn it off.
How do I do this?

Marc
--
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/   |   Finger [hidden email] for PGP key
Reply | Threaded
Open this post in threaded view
|

Re: reducing file I/O during a file edit

Kyle Wheeler
On Monday, June 27 at 10:16 AM, quoth Marc MERLIN:
>As far as I can tell, it's vim 'did this file get changed from under
>me' support, and I'd love to turn it off.
>How do I do this?

Hmm... as far as I know, you'd have to hack the source. Here's a little
bit of help... this feature is described in

    :help timestamp

In there, it seems to indicate that the "this file is different!" check
only happens after vim is told to do something that has repercussions
outside of vim (e.g. run a program, or awake from sleep). I don't
*quite* buy it that that's the ONLY time it happens, though.

Good luck,
~Kyle
--
The government is like a baby's alimentary canal, with a happy appetite
at one end and no responsibility at the other.
                                                        -- Ronald Reagan

signature.asc (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: reducing file I/O during a file edit

Steve Hall-4
In reply to this post by Marc MERLIN-2
On Mon, 2005-06-27 at 10:16 -0700, Marc MERLIN wrote:

> I'm using vim over a slow NFS connection (transatlantic) Yes, you
> can make fun of me, but when you're done laughing, can you help me
> out with this:
>
> Each cursor reposition causes this file I/O":
> open(".", O_RDONLY|O_LARGEFILE)         = 4
> fchdir(4)                               = 0
> chdir("var/lib/getupdates")             = 0
> getcwd("/home/merlin/mydir/files/var/lib/getupdates", 1024) = 59
> fchdir(4)                               = 0
> close(4)                                = 0
> getcwd("/home/merlin/mydir/files", 1024) = 40
>
> As far as I can tell, it's vim 'did this file get changed from under
> me' support, and I'd love to turn it off.
> How do I do this?

I've just been troubleshooting this same problem, too. Here's what has
appeared to fix it for me on a Windows network:

  autocmd VimEnter,BufEnter * execute "cd " . $HOME

I wish there was a way to efficiently know/test whether a file is at
distance/high latency, because then it could be made more conditional,
I'd rather the current directory match the current buffer.

HTH.


--
Steve Hall  [ digitect mindspring com ]
:: Cream... something good to put in your Vim!
::   http://cream.sourceforge.net


Reply | Threaded
Open this post in threaded view
|

Re: reducing file I/O during a file edit

Marc MERLIN-2
On Tue, Jun 28, 2005 at 09:17:55PM -0400, Steve Hall wrote:
> I've just been troubleshooting this same problem, too. Here's what has
> appeared to fix it for me on a Windows network:
>
>   autocmd VimEnter,BufEnter * execute "cd " . $HOME

HOME was nfs, but I put a cd /tmp and that worked fine.
thanks for the workaround

Marc
--
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/   |   Finger [hidden email] for PGP key