-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.stale
Description
I am guessing that node.js startup could be optimized if we specify the (only) location of node_modules. I believe that the fs gets peppered with stat requests on startup, but if we had something like this:
$ node --nm="./node_modules" dist/main.jsthen when non-relative require statements were evaluated, they could jump to the location specified by --nm, this might save hundreds of stat calls on startup?
I would venture to guess that 95% of npm projects only have one relevant node_modules dir, so walking up the filesystem for nested files could be optimized.
I would guess that there may already be some optimization for this in place, where directories are marked as not having a node_modules dir within them on first pass, but maybe there's more optimization to be had?
peq42, ORESoftware, prog1dev and DiegoRBaquero
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.stale