Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: VCS_info seems really slow on remote filesystem
- X-seq: zsh-workers 44902
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: VCS_info seems really slow on remote filesystem
- Date: Fri, 8 Nov 2019 10:24:46 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm1; bh=1qiIrPu9Ja93Ct88UFlPYP89Y4L3lcpJwhIBTfJ8 LqY=; b=l97vths9bhmM7r0T7n65ItRpjihKOWXd/lMZ+eK2xnGuALDOe2snsSo9 Mhm2diRpnh1vizpGb+9EWECY4q0nSHz69r1i+ANLAbIN1x8QztSP0SYJ42jFEkzT i7+i32VQOiNtN05cSDmuPDk3yAOCIr9D89ih2gqCd2j2w9S7SYaNH455+brS/+GV MRKHKACyYtXFzUUBC3TlUinSAq9jZWilN0ozAW4tU5HvKvItjVK9tDDeU5wVyoix SSjCDCZ6I+ddJ6Ns/C9hSmoljQD8w+WoJXXon8lDWkobq18DlfNeUHWpkCFPUj+t Jubrq4/68eJLKgMRsrp3XaHKuF3zdQ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=1qiIrPu9Ja93Ct88UFlPYP89Y4L3lcpJwhIBTfJ8L qY=; b=tlRjAGuAvbvaFAUcV5p91BJLmyyDvI/yAd+VGB23WlwHb9SfHlTTGD+F9 EiL+F09FmuGcNyx5CRzd8Mw+yRmtdIXBJWt+R3yqT5TtiQO1ljLX2ibfdJ7yELHV 0rRBM2qUIo9qAEZZrTkQLCkWs24Rhu8jUD67Psr9A9V+yeIEA+eHsqeuUTYQ5eSn GJe73HgoHg/btE86VOUUMAODthfi6t34f+oujW+HS3T7BxpS977tE4/j/3i+7wk1 9JMIAcEZarspjTHZNs1hQo5k8b4ZUoMwhJtjgjpwctPV5k4RqShqsmNFqx4fWco7 cDX5+/pDXo2NUdbISmkNIDehu6EPQ==
- In-reply-to: <CAH+w=7bhriPAtqr=dAwPhfiW45rX0SmxjyYwPMeXgjQiOX5rKw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAH+w=7bhriPAtqr=dAwPhfiW45rX0SmxjyYwPMeXgjQiOX5rKw@mail.gmail.com>
Bart Schaefer wrote on Thu, Nov 07, 2019 at 19:41:13 -0800:
> 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?
The tests are also needed if a git command has been run from another shell.
For example, if you run «git checkout master» in one shell and then press
<Enter> on an empty command line in another shell, that other shell will
re-run vcs_info.
Is the check-for-changes style set?
> 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?
>
Possibly. Question (to the list): Can we invalidate the cache automatically?
For example, could we avoid running all those file/directory existence tests in
VCS_INFO_git_getbranch unless the mtime of .git/<something> has changed since
the last call? This way, we'd do fewer checks in all cases, not just in slow
mountpoints.
> (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.)
As a last resort, you can set the disable-patterns style, but it disables
vcs_info completely for the directories it matches; even running vcs_info
interactively at the prompt won't bypass it. (Arugably it should, though…)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author