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

outdated command is inefficient #2632

Closed
aparajita opened this issue Jun 15, 2020 · 7 comments
Closed

outdated command is inefficient #2632

aparajita opened this issue Jun 15, 2020 · 7 comments

Comments

@aparajita
Copy link
Contributor

aparajita commented Jun 15, 2020

pnpm version:

5.1.8

Code to reproduce the issue:

pnpm outdated

Behavior:

I hope for pnpm outdated to be as fast as updates. Here's the results for pnpm outdated vs updates in a project with 94 top level dependencies:

$ time pnpm outdated
pnpm outdated  2.44s user 0.60s system 30% cpu 9.856 total

$ time updates
updates  1.19s user 0.15s system 74% cpu 1.810 total

updates is >2x faster. And it uses 6x less bandwidth!

Since updates is open source, why not just use their algorithm (with attribution of course)?

Additional information:

  • node -v prints: v14.3.0
  • Windows, OS X, or Linux?: macOS
@aparajita aparajita changed the title outdated check is inefficient outdated command is inefficient Jun 15, 2020
@zkochan
Copy link
Member

zkochan commented Jun 15, 2020

We have the fastest installation, so our codebase should be able to have the fastest outdated command. There are probably just some inefficiencies that needs to be fixed.

@aparajita
Copy link
Contributor Author

You might as well look at update's code for clues. 😁

@zkochan
Copy link
Member

zkochan commented Jun 16, 2020

Try 5.2.0

@aparajita
Copy link
Contributor Author

Will do. I'll do a new comparison with updates on the same repo.

@aparajita
Copy link
Contributor Author

pnpm outdated  1.29s user 0.29s system 80% cpu 1.958 total
updates  1.12s user 0.14s system 100% cpu 1.257 total

Much better! But still 56% slower than updates.

@zkochan
Copy link
Member

zkochan commented Jun 16, 2020

Maybe we can come up with some other improvements but I don't have more ideas at the moment. There is nothing special in the codebase of "updates". They use npm's package for fetching metadata. But they don't read any of the npm configs (we do). And they probably have less code, so the CLI startup is faster.

Our CLI startup is pretty slow. Probably that's the reason.

@aparajita
Copy link
Contributor Author

It isn't worth worrying about. 56% slower is way better than 200% slower.

@zkochan zkochan added this to the v5.2 milestone Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants