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

Slow startup performance on nvm and rvm #8

Closed
patricktruebe opened this issue Jan 9, 2017 · 3 comments
Closed

Slow startup performance on nvm and rvm #8

patricktruebe opened this issue Jan 9, 2017 · 3 comments

Comments

@patricktruebe
Copy link

Hey Lars,

thank you very much for sharing your great set of dotfiles. I am experiencing a very slow start with nvm and rvm bash-files enabled in runcom/.bash_profile. It takes nearly 5 seconds to launch a new shell. Disabling both modules reduces startup time to below 1 second.

Do you see similar results with your setup?

Patrick

@webpro
Copy link
Owner

webpro commented Jan 10, 2017

Thanks, @patricktruebe! Yes, it's pretty much the same for me: much faster without the rvm and nvm scripts. I'm very interested in speeding it up, but I don't have the time right now to dive into this.

@webpro
Copy link
Owner

webpro commented Feb 8, 2017

For me, rvm isn't slow, it's nvm (also see nvm-sh/nvm#1277).

I got it down from 2.9s to 2.2s by hard-coding the nvm path in system/.nvm:

# before:
source $(brew --prefix nvm)/nvm.sh

# after:
source /usr/local/opt/nvm/nvm.sh

Without this line (ie. without nvm), boot time is only 1.4s for me. I'm benchmarking like this:

lars@Blade ~ ❯ time . .dotfiles/runcom/.bash_profile 

real	0m1.408s
user	0m0.865s
sys	0m0.369s

@webpro
Copy link
Owner

webpro commented May 17, 2017

Hi @patricktruebe, I've done some work in my dotfiles. Regarding the performance issue, there were two calls to brew --prefix, which I'm now caching (in .cache.sh). This cache file could be used for more expensive calls, if we come across them.

If you want to try it, you can run the install.sh script again, or just the changes in brew.sh and npm.sh from 946ce7f.

I'm going to close this issue now, but feel free to discuss (and I'll be happy to re-open).

@webpro webpro closed this as completed May 17, 2017
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

2 participants