zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: VCS_info seems really slow on remote filesystem
Date: Thu, 7 Nov 2019 19:41:13 -0800	[thread overview]
Message-ID: <CAH+w=7bhriPAtqr=dAwPhfiW45rX0SmxjyYwPMeXgjQiOX5rKw@mail.gmail.com> (raw)

I've been invoking vcs-info from a precmd hook and using the
git-post-backend-updown hook to update my prompt.  Recently I started
using what amounts to a WAN-mounted file system, and find my prompt
takes a couple of seconds to redraw after each command.

After some fiddling around to enable function tracing I discovered
that VCS_INFO_detect_git is trying two different "git rev-parse" calls
and also looking for two subdirectories, and that
VCS_INFO_git_getbranch is looking for five more directories and four
files.  Those directory/file existence tsts are all slow operations on
this filesystem, and in at least some of the cases appear to be tests
that would only need to be done if the current directory changed?

Is there anyone more familiar than I with the implementation than I,
who could determine whether any of this information could be cached
instead of being regenerated on every precmd?

(I've seen gitstatus recommended in another thread, but it's not
feasible to install the binary daemon in the circumstances where I'm
encountering this.)

             reply	other threads:[~2019-11-08  3:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08  3:41 Bart Schaefer [this message]
2019-11-08  4:00 ` Bart Schaefer
2019-11-08 10:24 ` Daniel Shahaf
2019-11-08 10:32 ` Roman Perepelitsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7bhriPAtqr=dAwPhfiW45rX0SmxjyYwPMeXgjQiOX5rKw@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).