mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-11-11 19:21:49 -05:00
perf(lib): autoload the omz CLI and omz_diagnostic_dump
lib/cli.zsh (944 lines) and lib/diagnostics.zsh (353 lines) were parsed on every startup to define functions that most shells never call. Move them to $ZSH/functions/, which is already on $fpath, and autoload the two entry points from oh-my-zsh.sh instead. The `omz` completion moves to $ZSH/completions/_omz where compinit picks it up on its own. Measured on macOS arm64, zsh 5.9: ~1.7 ms less per interactive start. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
426650fbe8
commit
610d66ae06
@@ -78,6 +78,9 @@ fpath=($ZSH/{functions,completions} $ZSH_CUSTOM/{functions,completions} $fpath)
|
||||
# Load all stock functions (from $fpath files) called below.
|
||||
autoload -U compaudit compinit zrecompile
|
||||
|
||||
# The omz CLI and omz_diagnostic_dump are loaded on first use
|
||||
autoload -Uz omz omz_diagnostic_dump
|
||||
|
||||
is_plugin() {
|
||||
local base_dir=$1
|
||||
local name=$2
|
||||
|
||||
Reference in New Issue
Block a user