Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] <pnpm did it - why not npm as well? > #7234

Closed
2 tasks done
onexbash opened this issue Feb 20, 2024 · 5 comments
Closed
2 tasks done

[BUG] <pnpm did it - why not npm as well? > #7234

onexbash opened this issue Feb 20, 2024 · 5 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x

Comments

@onexbash
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

  • 35.6s for 115 packages(clean install)
  • 12.3s for 115 packages(with lock file)

Expected Behavior

  • 9s for the same 115 packages (clean install)
  • 5.4s for the same 115 packages (with lock file)

Steps To Reproduce

  1. Delete node_modules & package-lock
  2. Run npm install + stopwatch
  3. Delete node_modules & package-lock again
  4. Run pnpm install + stopwatch

=> You'll recognize that pnpm is ~4x faster.
=> Without deleting node_modules & package-lock, npm & pnpm offer similar performance, but as we are in 2024 and everything uses pods & containers, it's more important than ever to deploy fast.

Environment

  • pnpm:
  • Node.js: 20.11
  • OS Name: OSX Sonoma
  • System Model Name: Mac M2 Pro
package-manager=pnpm
registry=https://registry.npmjs.org/
user-agent=pnpm/8.15.3 npm/? node/v21.6.2 darwin arm64
@onexbash onexbash added Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x labels Feb 20, 2024
@ljharb
Copy link
Contributor

ljharb commented Feb 20, 2024

Regardless of your CLI tool, you shouldn't be installing deps at deploy time - you should be deploying a fully installed application.

@onexbash
Copy link
Author

@ljharb Definitely! But you cherrypicked one false expression "important to deploy fast" to dodge the key question. Why can the most used & default nodejs package manager that is developed since 2010 not compete with a small community that started developing js package managers in 2016? If there were promising plans, to improve npm, I wouldnt say one word, but it feels like nothing happens and criticism is not taken serious.

@ljharb
Copy link
Contributor

ljharb commented Feb 20, 2024

I'm not sure what you mean by "not compete".

Speed is one metric, but correctness is a much more important one - and npm has improved a lot over every year in the past 10, so again, I'm not sure what you're referring to.

@paulius-valiunas
Copy link

Regardless of your CLI tool, you shouldn't be installing deps at deploy time - you should be deploying a fully installed application.

I think I should point out that in a CI/CD pipeline, "deploy time" and "build time" are essentially the same. Either way, the install (node_modules) should definitely NOT come from a developer machine, it should come from a build agent, and more often than not these days, build agents are containers. So just replace "deploy fast" with "build fast" if you like, but what OP said makes perfect sense either way.

One detail I might nitpick on is that performance should always be compared with the lock file in tact - I just don't see a legitimate use case where you would need a fast build without one. Node_modules, on the other hand, should be deleted.

@wraithgar
Copy link
Member

This does not appear to be an actual bug report, but more of a general complaint. If you have an actionable way to speed npm up please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x
Projects
None yet
Development

No branches or pull requests

4 participants