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

Grafast: hoisting of subroutines #2041

Open
benjie opened this issue May 1, 2024 · 0 comments
Open

Grafast: hoisting of subroutines #2041

benjie opened this issue May 1, 2024 · 0 comments

Comments

@benjie
Copy link
Member

benjie commented May 1, 2024

This example:

https://github.com/scottravio/grafast-memory-spike-repro/blob/bf3b601b50949f81625cc767be5a323d76926f5c/languageplugin.mjs

Creates a subroutine via the each() step, but this step isn't dependent on the current user so theoretically it could be hoisted. Current it is not hoisted, which is resulting in the transform being executed NUMBER_OF_USERS * NUMBER_OF_LANGUAGES times, whereas it should only need to happen NUMBER_OF_LANGUAGES times. We should investigate hoisting the subroutine to make these usages more efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🐭 Shrew
Development

No branches or pull requests

1 participant