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

Avoid generators when crawling module graph #10529

Merged
merged 2 commits into from
Mar 22, 2024
Merged

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Mar 22, 2024

Changes

Avoid generators when crawling the module graph. Instead calculate the entire array directly and return it. In most cases, we're using the entire array so benefits of generators like able to bail out of iterating wasn't used.

Testing

existing tests should pass

In the astro docs repo, the Rollup build time went from 3m to 2m40s.

Docs

n/a. internal refactor.

Copy link

changeset-bot bot commented Mar 22, 2024

⚠️ No Changeset found

Latest commit: f4311ec

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 22, 2024
@matthewp
Copy link
Contributor

Needs a changeset. And this upsets me a lot.

@matthewp
Copy link
Contributor

!bench memory

Copy link
Contributor

PR Benchmark

Memory

Elapsed time (s) Memory used (MB) Final memory (MB)
SSR build 2.98 91.40 130.32
Client build 0.08 0.35 130.51
Static generate 0.45 4.89 134.74

Main Benchmark

Memory

Elapsed time (s) Memory used (MB) Final memory (MB)
SSR build 2.90 91.56 130.44
Client build 0.09 0.38 130.63
Static generate 0.44 4.99 134.90

@bluwy bluwy merged commit ca5455a into main Mar 22, 2024
13 checks passed
@bluwy bluwy deleted the remove-crawl-generators branch March 22, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants