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

Improves yarn run performances #2564

Merged
merged 2 commits into from
Mar 5, 2021
Merged

Improves yarn run performances #2564

merged 2 commits into from
Mar 5, 2021

Conversation

arcanis
Copy link
Member

@arcanis arcanis commented Mar 5, 2021

What's the problem this PR addresses?

We were always re-requiring the PnP API anew, even inside tight loops.

Closes #2560

How did you fix it?

The PnP API is now cached. This should be fine, considering that users will just have to create a new linker (from the configuration class) to clear all such caches.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@arcanis
Copy link
Member Author

arcanis commented Mar 5, 2021

Just tried it on my work repository: time to run a dummy script went from 4.5s down to 2s. Still some area of improvement, but a clear win.

@merceyz
Copy link
Member

merceyz commented Mar 5, 2021

Tested on a work repository as well, but from a plugin consuming the API to find the location of packages (which run does as well but that's not the point), finding the location of 58 dependencies went from 3745ms to ~200ms 👍 🎉

@arcanis arcanis merged commit c8bc1d5 into master Mar 5, 2021
@arcanis arcanis deleted the mael/faster-scripts branch March 5, 2021 21: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.

[Bug] Bad performance
2 participants