From 42e1452f637bd0284bbaf045cfc875bdbfc311a9 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 05:11:15 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Bolt:=20Remove=20redundant=20compin?= =?UTF-8?q?it=20for=20faster=20shell=20startup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: kaovilai <11228024+kaovilai@users.noreply.github.com> --- zsh/znap.zsh | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/zsh/znap.zsh b/zsh/znap.zsh index 44e54460..306f796c 100644 --- a/zsh/znap.zsh +++ b/zsh/znap.zsh @@ -3,22 +3,8 @@ zstyle ':znap:*' repos-dir ~/.zsh-snap # Extend cache TTL to reduce network requests and speed up shell startup zstyle ':znap:*:*' ttl 604800 # Cache for 7 days (in seconds) -autoload -Uz compinit -# Run full compinit when: -# - the dump doesn't exist yet (first run), OR -# - the dump is older than 24h (mh+24 = modified more than 24h ago) -# Otherwise use -C to skip the fpath security scan for faster startup. -() { - # Optimization: Use native Zsh extended globbing qualifiers efficiently - setopt local_options extended_glob - local _zcompdump="${ZDOTDIR:-$HOME}/.zcompdump" - local -a stale_dump=($_zcompdump(#qN.mh+24)) - if [[ ! -f $_zcompdump ]] || (( ${#stale_dump} > 0 )); then - compinit # no dump or stale: rebuild and re-check fpath security - else - compinit -C # dump is fresh: skip security scan for faster startup - fi -} +# Optimization: Znap automatically handles compinit and comp dumps out of the box. +# Manually calling compinit degrades shell startup performance due to redundant execution. # Download Znap, if it's not there yet. [[ -f ~/git/zsh-snap/znap.zsh ]] ||