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

Defer initialising nvm until first use #14

Open
RasmusWL opened this issue Mar 8, 2018 · 1 comment
Open

Defer initialising nvm until first use #14

RasmusWL opened this issue Mar 8, 2018 · 1 comment

Comments

@RasmusWL
Copy link

RasmusWL commented Mar 8, 2018

Starting fish with this plugin is quite slow. Without nvm 0:00.03elapsed, with nvm 0:00.55elapsed.

I have a noticeable delay when staring my program launcher. Would be really great if it was possible to load nvm on first use, instead of when this plugin is loaded.

$ omf remove nvm
nvm successfully removed.

$ time fish -c exit
0.02user 0.00system 0:00.03elapsed 100%CPU (0avgtext+0avgdata 5880maxresident)k
0inputs+0outputs (0major+1064minor)pagefaults 0swap

$ omf install nvm
Updating https://github.com/oh-my-fish/packages-main master... Done!
Installing package nvm
✔ nvm successfully installed

$ time fish -c exit
0.51user 0.08system 0:00.55elapsed 107%CPU (0avgtext+0avgdata 36024maxresident)k
0inputs+8outputs (0major+32142minor)pagefaults 0swaps
@FabioAntunes
Copy link

FabioAntunes commented Sep 11, 2018

Hey @RasmusWL that was the main reason why I created, https://github.com/FabioAntunes/fish-nvm

It delays sourcing nvm, until you actually need it. The problem in delaying nvm is that the global npm packages installed are not added to the path, so you have to create alias.

Everything is explained on the Readme

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