Skip to content

[Perf] remove subprocess forks from startup and nvm use paths - #3949

Merged
ljharb merged 8 commits into
nvm-sh:masterfrom
marble-sh:perf/fork-free-startup
Oct 8, 2026
Merged

ljharb merged 8 commits into
nvm-sh:masterfrom
marble-sh:perf/fork-free-startup

Conversation

@marble-sh

@marble-sh marble-sh commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

the benchmark script written for this pull request and it's results can be found here: https://gist.github.com/marble-sh/6db64630838b0fc9c003b6e0b311373e . in general i've found these changes give a 100ms or more savings.

please let me know what i can do to improve the PR. i'm happy to split, narrow, or reorder as wanted.

addresses: #2334, #3410, #3416, #3425, #3508, #3811, #3930, #3935

if asked, i'd be happy to add the benchmark scripts to the pull request, or create a new pull request for them specifically.

…m_ls`

An alias of the same name still takes precedence, as it does in `nvm_ls`.
… -a`

The file is read, not sourced. An `ID` with no OS of its own is only taken as Linux when the kernel's `ostype` says so; otherwise `uname -a` decides.
In zsh, `command printf` skips the builtin and forks `/usr/bin/printf`.
@marble-sh
marble-sh force-pushed the perf/fork-free-startup branch from 3d8980c to 55810db Compare October 7, 2026 16:15
@marble-sh
marble-sh force-pushed the perf/fork-free-startup branch 3 times, most recently from 20d4dc5 to f354088 Compare October 7, 2026 21:37
@marble-sh
marble-sh marked this pull request as ready for review October 7, 2026 21:57
@marble-sh
marble-sh force-pushed the perf/fork-free-startup branch from f354088 to 4034135 Compare October 8, 2026 20:37
@ljharb
ljharb force-pushed the perf/fork-free-startup branch from 4034135 to d55a55c Compare October 8, 2026 22:18
@ljharb
ljharb merged commit d55a55c into nvm-sh:master Oct 8, 2026
403 of 404 checks passed
@marble-sh
marble-sh deleted the perf/fork-free-startup branch October 13, 2026 12:30
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

Successfully merging this pull request may close these issues.

2 participants