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

Already on GitHub? Sign in to your account

Load paths in background #504

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

I've been able to reduce zsh loading time by putting some stuff in background.
So I moved from more than 2 seconds the 0.40 seconds

So here is my ~/.zshrc

typeset -F SECONDS
start=$SECONDS
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh

ZSH_THEME="robbyrussell"
DISABLE_AUTO_UPDATE="true"
plugins=(git osx lol macports node npm vi-mode taskwarrior)
source $ZSH/oh-my-zsh.sh
bg_source ~/.oh-my-zsh/history-substring-search.zsh

path_unshift /opt/local/bin:/opt/local/sbin
path_push /opt/local/lib/postgresql83/bin/:/usr/local/bin/
path_push /Applications/calibre.app/Contents/MacOS:/Applications/VLC.app/Contents/MacOS

[[ -s "$HOME/.rvm/scripts/rvm" ]] && bg_source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
[[ -s "$PWD/.rvmrc" ]] && bg_source "$PWD/.rvmrc" # This loads RVMRC


# measure how long it takes to load
print Load time: $(( $SECONDS-$start )) seconds

Contributor

gwjo commented Aug 3, 2011

I must be missing something but I don't see how this is doing anything in the background, bg_source just calls source directly which happens in the current shell context.

Owner

robbyrussell commented Apr 24, 2013

@framallo what @gwjo said. Can you explain this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment