Very slow
I installed zsh-quickstart-kit with spf13, and the loading time is very slow. I haven't customized it, so it appears to be the default setting that slows down my system.
Using iTerm2 on OS X 10.11.
I was hoping that zgen would solve slowliness issues I was experiencing with antigen, but that's not the case. Do you have any recommendations for speeding up the system?
I suspect the problem may be the oh-my-zsh plugins. Try commenting them out of your .zgen-local-plugins and see if that improves your start times.
I've been considering yanking the o-m-z plugins from the starter kit anyway, so let me know whether that helps.
It's still faster than o-m-z 😀 at least.
Ok, I copied the content of load-starter-plugin-list from .zgen-setup to a new .zgen-local-plugins file, then commented all loads of oh-my-zsh plugins. It is definitely faster, although it still takes more than a second to load a shell.
Also, I find that the omz plugins are what make zsh great to use. If I cannot have all the shortcuts and autocompletion features provided by all these plugins (aws, git, tmux, etc), the usefulness is limited ^^
I'm wondering why we cannot load plugins in deferred (give the user his shell asap with the strict minimum, then load other plugins afterwards). Do you have any idea about that?
Thanks for the quick answers :)
At some point I need to do a binary search and figure out which plugins are the slow ones. What hardware are you running where it is taking more than a second to load?
Currently running on a Mac mini (Late 2014) with 2.6GHz Intel Core i5 and 8GB 1600MHz DDR3.
Thank you @unixorn, I look forward to your profiling. Sorry I don't have time to do it myself ^^'
I'm unlikely to find time for it anytime soon, unfortunately.
If this is still an issue I’ve got a timing and latency zsh dingus you can test with.
That timer sounds interesting, please send me a link so I can look at timing some of this stuff.
OMG, time zsh -i -c exit gave me over 10s to open the shell.
I ~~commented out most of the oh-my-zsh and other things~~ replaced nvm with fnm and I reached to 1.112s total. Still very interested in reducing the time.
zgen-update takes most of the time. I tried this setup with zinit (turbo mode) instead of zgen and zsh takes ~0.2 sec to start.
Pros
- zsh start-up time improved
Cons
- I lost the zgen and zsh-quickstart-kit auto-update feature.
- zinit is more complicated than zgen
- needs to compile every time I update something in ~/.zshrc.d/
- it took some reading to correctly load the plugin (plugin/snippet/completion in zinit term)
- some loading methods make keyboard input appears not working
- (above facts makes) not suitable for zsh-quickstart-kit
other details
- zsh: 5.8
- CPU: i7 (3rd gen) @ 3.1 GHz
- Mem: 8 GB
- OS: Arch Linux x86_64
- Terminal: konsole 20.04.2
I am having this problem as well. Any chance of working on this one? I commented out everything that was Mac related still seams slower.
It's taken me forever to get to it, but I'm working on switching the quickstart kit to use zgenom instead of zgen.
zgenom is getting maintenance, and relevant to this issue, optionally adds precompilation for the zsh plugin files that it loads. If you're interested in trying it, please switch your clone to the switch-to-zgenom branch, and comment here or on the PR (https://github.com/unixorn/zsh-quickstart-kit/pull/88) if you run into issues.
I'm hoping to make this go live 2020-11-21 at the latest.
I switched over to the new branch and I am encountering this error on an Apple Silicon Big Sur OS:
.zgen-setup updated; creating a new init.zsh from plugin list in zsh-quickstart-kit/zsh/.zgen-setup
Creating a zgen save
-- zgenom: Creating /Users/jfmcdowell/.zgenom/init.zsh ...
-- zgenom: Compiling files ...
/Users/jfmcdowell/.zsh_functions:90: defining function based on alias procs_for_path' /Users/jfmcdowell/.zsh_functions:90: parse error near ()'
When troubleshooting locally I came across this issue: https://github.com/ohmyzsh/ohmyzsh/issues/6723
and I made a modification to .zsh_functions:90 by adding the keyword function:
function procs_for_path() {
for pid in $(lsof "$@" | cut -d' ' -f 3 | sort | uniq)
do
ps -f -p $pid
done
}
This suppressed the errors. Should all of the functions be explicitly defined this way to protect from alias expansion? Happy to open a PR.
I got the same errors as this last post. Following to see the response given.
/home/thechosenone/.zsh_functions:90: defining function based on alias procs_for_path' /home/thechosenone/.zsh_functions:90: parse error near ()'
adding the functions per above fixed the error.
I'm not sure why GH hasn't been notifying me of updates to this issue.
I don't have an M1 to test on. Declaring all functions with function seems an easy fix, @jfmcdowell if you'd like to PR that, I'm always happy to get PRs. otherwise I'll work on it this weekend.