Commit Graph
5 Commits
Author SHA1 Message Date
Hridhin Varkey Joseph 887c2969b7 [Perf] nvm_version: list installed versions once for node/stable
Once the newest installed version is 1.0 or later, `stable` is that version, so list the installed versions once and take the newest, instead of `nvm_ls stable` listing them three times.

Only 0.x installs (where `stable` is the newest even minor), a user alias named `stable`, and `--lts` filters keep the existing path. A system node, which `nvm_ls` lists last, is skipped.

Part of #3416.
2026-11-19 15:39:47 -08:00
Hridhin Varkey Joseph 913b8cb625 [Perf] nvm_resolve_local_alias: skip nvm_version for an exact, installed version
See #3416
2026-10-04 02:22:58 +05:30
Hridhin Varkey Joseph f1f3d463ab [Perf] nvm use: skip re-resolving an exact, installed version
When `nvm use` is given an exact `vX.Y.Z` that is already installed,
and no alias with that exact name exists,
use it directly instead of re-resolving it through
`nvm_match_version` and `nvm_ensure_version_installed`,
both of which call `nvm_version`.

`nvm_auto` takes this path on every shell startup with an already-resolved version,
so this removes ~95ms from each new shell
(~330ms -> ~235ms in a clean environment on macOS/zsh).

Fixes #3930
2026-10-01 09:51:16 +05:30
Hridhin Varkey Joseph ed1b96f5db [readme] explain the misleading npm install error from npm run test/fast 2026-10-04 00:49:18 +05:30
Hridhin Varkey Joseph a27fb0bd78 [Tests] add unit tests for nvm_version_greater_than_or_equal_to 2026-10-03 11:51:31 +05:30