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

fix(perf): lazy load glob on normalize.js #89

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

H4ad
Copy link
Contributor

@H4ad H4ad commented Apr 10, 2024

Since npm run didn't call those steps, we can save some ms by lazy loading this dependency.

Before:

image

After:

image

The entire load time didn't change, still 13ms before & after, but if we call npm run inside a project that didn't have workspaces, we will save some ms, like this one:

image

But this will also require the PR npm/cli#7360 to be merged.

@wraithgar
Copy link
Member

Note: this gypfile step only runs on prepare, it is not in the run path when installing a package, only when publishing. Thus it's not a concern for npm i -g npm

@wraithgar wraithgar merged commit 06df698 into npm:main Apr 10, 2024
20 checks passed
wraithgar pushed a commit that referenced this pull request Apr 10, 2024
Combined with #89, we can reduce the load time of `normalize` to less
than `1ms`, making the `run-script` load in `4ms` instead of `13ms`.
@github-actions github-actions bot mentioned this pull request Apr 10, 2024
wraithgar pushed a commit that referenced this pull request Apr 10, 2024
🤖 I have created a release *beep* *boop*
---


## [5.0.2](v5.0.1...v5.0.2)
(2024-04-10)

### Bug Fixes

*
[`a67317b`](a67317b)
[#90](#90) perf: lazy load
hosted git info on normalize (#90) (@H4ad)
*
[`06df698`](06df698)
[#89](#89) perf: lazy load glob
on normalize.js (#89) (@H4ad)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@H4ad H4ad deleted the perf/lazy-load-glob branch April 10, 2024 15:58
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.

2 participants