-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
load-nvmrc is slow #1694
Comments
This is just a suggestion in the readme; its code isn't actually part of nvm. If you'd like to PR in improvements to it, that'd be appreciated! |
@ljharb that is true, but this function use nvm's functions for example take
it takes and if change this code local pathdir
pathdir=$(dirname "${node_path}")
while [ "${pathdir}" != "" ] && [ "${pathdir}" != "." ] && [ "${pathdir}" != "/" ] && [ "${pathdir}" != "${tree}" ]; do
pathdir=$(dirname "${pathdir}")
done
[ "${pathdir}" = "${tree}" ] on something like this [ "$tree${node_path#$tree}" = "${node_path}" ] you could reduce the time from Thanks |
@maksimr now that seems much more compelling a change to me. Would you be willing to make a PR for that? :-D |
I have similar problem nvm takes to much time to start, stats below. Any sollution for that?
|
load-nvmrc
[1] function is very slow.It spends around
220ms
on check and it runs on every change directory(cd)OS: macOs High Sierra
Processor: 2,2 GHz Intel Core i7
Termina: iTerm2(3.1.5)
Shell: zsh 5.3 (x86_64-apple-darwin17.0)
Test:
We could reduce time to
60ms
if removeelif
clause but60ms
is still a measurable delay.nvm version
takes53ms
[1] - https://github.com/creationix/nvm#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file
The text was updated successfully, but these errors were encountered: