-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds an initial reviewneeds an initial review
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When profiling npm ci, I observed that 20% of the CPU time spent in my monorepo was URL.parse, and almost all of that time is in HostedGit.fromUrl. Which is a cost that feels bad to pay in my monorepo, which has a single git URL as a specifier out of thousands of dependencies otherwise.
Expected Behavior
HostedGit.fromUrl would only be invoked if the specifier being resolved looks like a URL.
Steps To Reproduce
- Attach a profiler to an
npm ciinvocation, e.g. by runningnode --inspect-brk <path to npm.js> ci. - Record a performance profile while npm ci is run
- URL.parse has the most self time
Environment
- npm: 11.6.0
- Node: 22.17.0
- OS: Windows 11
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds an initial reviewneeds an initial review