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

perf(read-project-manifest): optimize normalize function #6763

Merged
merged 1 commit into from Jul 4, 2023

Conversation

zxbodya
Copy link
Contributor

@zxbodya zxbodya commented Jul 4, 2023

  • use lodash deepClone instead of JSON.parse(JSON.stringify), which is few times faster
  • clone dependencies objects only once(when sorting)
  • replace sortKeys usage with a simpler alternative(given we do not have nested structure to be sorted recursively, but a plain object - it can be done faster)

before
Screenshot 2023-07-04 at 10 53 46

after
Screenshot 2023-07-04 at 10 54 09

@zxbodya zxbodya requested a review from zkochan as a code owner July 4, 2023 08:54
@zkochan zkochan merged commit b4892ac into pnpm:main Jul 4, 2023
8 checks passed
@zxbodya zxbodya deleted the perf-optimize-normalize-manifest branch July 4, 2023 12:50
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.

None yet

2 participants