Skip to content

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.

@H4ad H4ad requested a review from a team as a code owner April 10, 2024 11:39
@H4ad H4ad force-pushed the perf/lazy-load-glob branch from 6d6b779 to 6e2e9b8 Compare April 10, 2024 11:47
@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
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