From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id d7957737 for ; Fri, 8 Nov 2019 03:42:11 +0000 (UTC) Received: (qmail 20152 invoked by alias); 8 Nov 2019 03:42:03 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44899 Received: (qmail 28899 invoked by uid 1010); 8 Nov 2019 03:42:03 -0000 X-Qmail-Scanner-Diagnostics: from mail-lj1-f178.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25622. spamassassin: 3.4.2. Clear:RC:0(209.85.208.178):SA:0(-1.9/5.0):. Processed in 1.965272 secs); 08 Nov 2019 03:42:03 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.208.178 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=vVZyxLbTX7LIjzhdd+T6fWXWc8QdE/MyY22/ohtzbog=; b=LPKpG7PafWmUP8rzqMtQnPQ5mAVYMEENWZNbxucOVlGCcf+g54qMI19xViNgz1E6cP TLGHFxXj3ZCOaLjmp8ib2ukjSftIDVuvj4lb1wm7lwEJp9e3LHKZ469di5qORk0KqSQ7 Dg2HkvbyOqN4hkrCvWm4cRoiiQR7+l2Hrfg9oKHLhGxwHH/+iptgAIzbRt4W5tT0qHZQ JYUeU23kZbhzh7cCdGCsA/eSou5Xm6mlSsGbWB9a3HN8sz60i0UrLjDDFAuqU1Lm4cJX 4NDrkOC0/txFUjHF6U5EnwVymc/meRpV/CChUiFGd9qSAr1935KqrSknhSMufNeHhosJ nxvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=vVZyxLbTX7LIjzhdd+T6fWXWc8QdE/MyY22/ohtzbog=; b=beUBlS6ZDIF10jgiK6J6idI7t2cZv0pbTbLADIXwjQyxm9OnIcdc37PBrzBR96tCzY CUW1035m8EJgyWbz5HNVo3LXIpUD3ePD5IIOGFxCKVDZaNkCyr2EgQeB7G0p8nC8V/WT y/8EkMF6ZeXreFokK/HTl1NKG0SKM0GA9E5g69f6NhJh4YeKHFWPMwwesx8PIt+eGWl+ f3PdNJ7SxwF+QDE4oSt21XqLHSOCeJfBe7a3q9DqGXUIbprPfE/G7QxjUX6i52P4cbU5 xsFQy1VFyI15u58GBydvXWRI8VTLuYnvOuFds9b5oeIENN+HT+5ot9e19yM6S6LZoLuD rtxQ== X-Gm-Message-State: APjAAAXUag3pcm64sSuG6ED6VgLqVcC2oocc/cbOMxs8069BP967M/o3 oQLxNX5P+xtD6NvvsHDzyI34Yhl936u/+rOP3VIsCcop0gdZHw== X-Google-Smtp-Source: APXvYqwPRDOF4oeD72vbdx5DSCzV/26OJxocW665y41tm40IEGjKgy8etj4y0OxFWFMk1X64Jyyt56vdP5qBCfjFEKI= X-Received: by 2002:a2e:b54d:: with SMTP id a13mr4976828ljn.4.1573184484947; Thu, 07 Nov 2019 19:41:24 -0800 (PST) MIME-Version: 1.0 From: Bart Schaefer Date: Thu, 7 Nov 2019 19:41:13 -0800 Message-ID: Subject: VCS_info seems really slow on remote filesystem To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" 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.)