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

Remove unused scope from Walker #1341

Merged
merged 1 commit into from
Sep 27, 2021

Conversation

chriskrycho
Copy link
Contributor

The scope info here is entirely unused in the Glimmer codebase. It may be used in some AST transforms, but this is fairly unlikely, since it has only been available since Ember 3.16. Profiling template compilation highlighted the recursive walking of the whole tree for locals in scope during syntax parsing as a major cost in CPU usage, so the hope is that removing this will help.

I also confirmed that this passes all of Ember's tests when integrating into Ember 3.28! 🎉

Here's the output of two runs (A and B) using the latest version of this branch on our repro repo. To summarize: this gets us back another ~8s closer to the baseline throughput.

compiler Run A Avg. (ms) Run B Avg. (ms)
[email protected] 2079 1943.8
[email protected] 14243.6 14807.4
[email protected] 15726 46872 [See Note]
@glimmer/[email protected] 2091.2 1968.8
@glimmer/[email protected] 48071.4 [See Note] 13615.2
@glimmer/compiler@master 4081 4130.6
@glimmer/compiler@experiment (this PR) 3248.4 3241.2

Note: There is something slightly odd happening – I suspect a quirk of the benchmark or of my machine setup, but haven't found what's causing it yet – where the 3.28 version will occasionally get "stuck" and have these blowup times. You can see that run A it showed up with a ~48s time on the @glimmer/[email protected] variant, and on run B it showed up on the [email protected] variant.

The `scope` info here is entirely unused in the Glimmer codebase. It may
be used in some AST transforms, but this is fairly unlikely, since it
has only been available since Ember 3.16. Profiling template compilation
highlighted the recursive walking of the whole tree for locals in scope
during syntax parsing as a major cost in CPU usage, so the hope is that
removing this will help.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants