summaryrefslogtreecommitdiffstats
path: root/ChangeLog
diff options
context:
space:
mode:
authorSuraj N. Kurapati <sunaku@riseup.net>2021-06-25 23:04:05 -0700
committerDaniel Shahaf <d.s@daniel.shahaf.name>2021-07-06 01:56:07 +0000
commitd634a3d333027561eb2d96120f3d40a876f1dd6f (patch)
treee5c1ea673c8af6b45cd30a000c7f48a783670094 /ChangeLog
parent49102: Ignore dynamic directory name failure if NO_EXEC (diff)
downloadzsh-d634a3d333027561eb2d96120f3d40a876f1dd6f.tar
zsh-d634a3d333027561eb2d96120f3d40a876f1dd6f.tar.gz
zsh-d634a3d333027561eb2d96120f3d40a876f1dd6f.tar.bz2
zsh-d634a3d333027561eb2d96120f3d40a876f1dd6f.tar.lz
zsh-d634a3d333027561eb2d96120f3d40a876f1dd6f.tar.xz
zsh-d634a3d333027561eb2d96120f3d40a876f1dd6f.tar.zst
zsh-d634a3d333027561eb2d96120f3d40a876f1dd6f.zip
49128 (github #76): vcs_info-examples: optimize +vi-git-untracked()
Speed up the prompt on large and/or deep working directories by stopping grep(1) as soon as it finds a single match, with `-q`. Also, correct the regexp by adding a ^ anchor and increase its specificity by accounting for the space in Porcelain Format v1. Previously, +vi-git-untracked() waited for grep(1) to find all matches of untracked files, redirecting them away to /dev/null, before finally concluding that untracked files do indeed exist. With this patch, I see 4x speedup on a large Git-enabled $HOME: $ time (git status --porcelain | wc -l) 212 0.01s user 0.02s system 0% cpu 9.021 total $ time (git status --porcelain | grep '??' &>/dev/null) 0.01s user 0.02s system 0% cpu 12.294 total $ time (git status --porcelain | grep -q '^?? ' 2>/dev/null) 0.01s user 0.01s system 0% cpu 3.097 total Note that `-q` for grep(1) is in POSIX (IEEE Std 1003.1-2017): https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html See discussion https://www.zsh.org/mla/workers/2021/msg01354.html
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog5
1 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 37f45f3b2..43129ecc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-07-06 Suraj N. Kurapati <sunaku@riseup.net>
+
+ * 49128 (github #76): Misc/vcs_info-examples: optimize
+ +vi-git-untracked()
+
2021-06-28 Peter Stephenson <p.stephenson@samsung.com>
* 49102: Src/subst.c: Dynamic directory expansion failure is