Performance zsh使用prezto启动提示速度极慢
我在用zsh和prezto。启动提示非常慢。我在Mac上使用iTerm2 这是我的Performance zsh使用prezto启动提示速度极慢,performance,zsh,zshrc,prezto,Performance,Zsh,Zshrc,Prezto,我在用zsh和prezto。启动提示非常慢。我在Mac上使用iTerm2 这是我的~/.zshrc # # Executes commands at the start of an interactive session. # # Authors: # Sorin Ionescu <sorin.ionescu@gmail.com> # # Source Prezto. if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; the
~/.zshrc
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
# Customize to your needs.
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
export PATH
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
autoload -U +X bashcompinit && bashcompinit
我有一种预感,模块的顺序会有所不同?此外,我还尝试删除了一些模块,但这似乎也没有什么不同。我也遇到了类似的问题,我解决问题的方法是: 将此行添加到我的
.zshrc
文件的最顶端:
zmodload zsh/zprof
其中包括文件开头的zsh分析模块zprof
然后打开一个新的终端会话(以便进行更改并加载zprof
)并执行
zprof
它给了我一份报告,说明了我的系统在哪里花费了大部分时间
在我的特殊情况下,它正在执行与nvm相关的任务。我怀疑OP也有类似的问题,因为他们正在加载节点
模块
因为我现在很少使用node,所以我卸载了所有与node相关的东西,包括nvm,并且还删除了.zshrc
上所有与node和nvm相关的行
这为我做到了,所以我注释掉了.zshrc
中的zmodload zsh/zprof
行
在谷歌搜索时,实际上每天都需要使用Node的人已经想出了其他解决方案
例如:
此人创建了一个名为zsh lazy load
()的zprezto模块,该模块可用于
免责声明:我自己没有尝试过
zsh lazy load
,所以我不能完全推荐它;只是添加了它,以防它对任何人都有用。您找到解决问题的方法了吗?没有,我刚刚摆脱了mac,回到了linux:)
zprof