Grafast: hoisting of subroutines
Open
✨ feature
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 625
- Avg merge
- 5h 23m
- Merged PRs (30d)
- 24
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.