zsh-quickstart-kit icon indicating copy to clipboard operation
zsh-quickstart-kit copied to clipboard

Very slow

Open AdrienLemaire opened this issue 9 years ago • 14 comments

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?

AdrienLemaire avatar Jul 13 '16 01:07 AdrienLemaire

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.

unixorn avatar Jul 13 '16 02:07 unixorn

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 :)

AdrienLemaire avatar Jul 13 '16 03:07 AdrienLemaire

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?

unixorn avatar Jul 13 '16 16:07 unixorn

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 ^^'

AdrienLemaire avatar Jul 14 '16 01:07 AdrienLemaire

I'm unlikely to find time for it anytime soon, unfortunately.

unixorn avatar Jul 14 '16 18:07 unixorn

If this is still an issue I’ve got a timing and latency zsh dingus you can test with.

quinnypig avatar Dec 30 '17 04:12 quinnypig

That timer sounds interesting, please send me a link so I can look at timing some of this stuff.

unixorn avatar Dec 30 '17 14:12 unixorn

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.

twnaing avatar Mar 19 '19 14:03 twnaing

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

twnaing avatar Jul 04 '20 07:07 twnaing

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.

DanitiKain avatar Nov 13 '20 05:11 DanitiKain

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.

unixorn avatar Nov 13 '20 17:11 unixorn

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.

jfmcdowell avatar Nov 30 '20 23:11 jfmcdowell

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.

DanitiKain avatar Dec 29 '20 16:12 DanitiKain

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.

unixorn avatar May 14 '21 13:05 unixorn