From 609d9ee4eacbbef1b28bf1b33d7f6551a0296674 Mon Sep 17 00:00:00 2001 From: Jo Liss Date: Fri, 27 Mar 2015 03:15:11 +0000 Subject: [PATCH 1/2] Improve startup performance. Closes #703 --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index 4b242bc..05a0bd1 100755 --- a/nvm.sh +++ b/nvm.sh @@ -1718,7 +1718,7 @@ if nvm_supports_source_options && [ "_$1" = "_--install" ]; then elif nvm_rc_version >/dev/null 2>&1; then nvm install >/dev/null fi -elif nvm ls default >/dev/null; then +elif nvm_alias default >/dev/null 2>&1; then nvm use default >/dev/null elif nvm_rc_version >/dev/null 2>&1; then nvm use >/dev/null From fc86834e29ba0534c79f56c828d3f69b4da2eb1c Mon Sep 17 00:00:00 2001 From: Jo Liss Date: Fri, 27 Mar 2015 03:17:42 +0000 Subject: [PATCH 2/2] Add comment re nvm_ensure_version_installed performance --- nvm.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nvm.sh b/nvm.sh index 05a0bd1..5ad3578 100755 --- a/nvm.sh +++ b/nvm.sh @@ -1347,6 +1347,8 @@ nvm() { return 8 fi + # This nvm_ensure_version_installed call can be a performance bottleneck + # on shell startup. Perhaps we can optimize it away or make it faster. nvm_ensure_version_installed "$PROVIDED_VERSION" EXIT_CODE=$? if [ "$EXIT_CODE" != "0" ]; then