nvm: Performance: `nvm use default` slow, slows down shell startup (nvm.sh)

. ~/.nvm/nvm.sh adds about half a second to shell startup. The main culprits seem to be nvm ls default and nvm use default - commenting them out drops the timing reported by time . ~/.nvm/nvm.sh to near-zero.

I wonder if we can speed those up, or replace them with a cheaper operation for shell startup?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 14
  • Comments: 23 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@dylanpyle Are you using oh-my-zsh? What’s your output of nvm debug? If you nvm unalias default, does the slowdown disappear?

Still takes almost a second for me to startup. If I remove the . ~/.nvm/nvm.sh my shell loads near instantly…