Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very slow #15

Open
AdrienLemaire opened this issue Jul 13, 2016 · 14 comments
Open

Very slow #15

AdrienLemaire opened this issue Jul 13, 2016 · 14 comments

Comments

@AdrienLemaire
Copy link

AdrienLemaire commented Jul 13, 2016

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?

@unixorn
Copy link
Owner

unixorn commented Jul 13, 2016

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.

@AdrienLemaire
Copy link
Author

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

@unixorn
Copy link
Owner

unixorn commented Jul 13, 2016

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?

@AdrienLemaire
Copy link
Author

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

@unixorn
Copy link
Owner

unixorn commented Jul 14, 2016

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

@QuinnyPig
Copy link

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

@unixorn
Copy link
Owner

unixorn commented Dec 30, 2017

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

@twnaing
Copy link
Contributor

twnaing commented Mar 19, 2019

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
Copy link
Contributor

twnaing commented Jul 4, 2020

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

@DanitiKain
Copy link

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.

@unixorn
Copy link
Owner

unixorn commented Nov 13, 2020

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 (#88) if you run into issues.

I'm hoping to make this go live 2020-11-21 at the latest.

@jfmcdowell
Copy link
Contributor

jfmcdowell commented Nov 30, 2020

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: ohmyzsh/ohmyzsh#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.

@DanitiKain
Copy link

DanitiKain commented Dec 29, 2020

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.

@unixorn
Copy link
Owner

unixorn commented May 14, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants