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

NVM_LAZY_LOAD not decreasing load time #70

Open
shaharke opened this issue Aug 5, 2020 · 3 comments
Open

NVM_LAZY_LOAD not decreasing load time #70

shaharke opened this issue Aug 5, 2020 · 3 comments

Comments

@shaharke
Copy link

shaharke commented Aug 5, 2020

I'm trying to use NVM_LAZY_LOAD to decrease the load time of my shell but it doesn't seem to have any effect.

This is my .antigenrc file

Load the oh-my-zsh's library.

antigen use oh-my-zsh

# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle git
antigen bundle github
antigen bundle brew
antigen bundle nvm
antigen bundle command-not-found
antigen bundle fzf
antigen bundle docker-compose

# zsh-users bundles
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-history-substring-search

# Custom bundles
export NVM_LAZY_LOAD=true
antigen bundle lukechilds/zsh-nvm

# Load the theme.
antigen theme robbyrussell

# Tell Antigen that you're done.
antigen apply

I run the following command to time my shell:

for i in $(seq 1 4); do /usr/bin/time $SHELL -i -c exit; done

Results without NVM_LAZY_LOAD:
5.25 real 2.19 user 2.40 sys
4.15 real 1.94 user 2.06 sys
3.75 real 1.86 user 1.85 sys
3.73 real 1.85 user 1.85 sys

Result with lazy loading:
4.18 real 1.94 user 1.98 sys
3.66 real 1.83 user 1.81 sys
3.65 real 1.81 user 1.81 sys
3.59 real 1.78 user 1.78 sys

@mihaiserban
Copy link

same for me too..

@lukechilds
Copy link
Owner

You probably need to remove antigen bundle nvm or OMZ's nvm plugin since they'll load nvm.

@ghost
Copy link

ghost commented Nov 25, 2020

Same here on oh-my-zsh, and I'm not loading NVM any other way AFAIK.
Takes 1.6 seconds without the plugin, and 19 seconds with the plugin.

export ZSH="/home/vbersier/.oh-my-zsh"
ZSH_THEME="robbyrussell"
export FZF_DEFAULT_OPTS="--height 50% --multi --info=inline"
export FZF_BASE="/home/vbersier/.fzf/bin/fzf"
export NVM_LAZY_LOAD=true
plugins=(zsh-nvm)
plugins+=(git)
plugins+=(zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
compinit

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

3 participants