-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[GLIMMER2] Optimize {{property}} PropertyReference #14041
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
Conversation
|
In my not completely scientific experiments, this accounts for over 10% improvement in initial render time. |
|
@mmun I thought we had tests that allowed {{str.length}} |
|
@krisselden that crossed my mind too, but I am just mirroring the current behavior |
|
@krisselden while you are here, can you review 4ce0954 ? |
|
There seems to be additional wins associated with the latest commits, but my setup is too noisy to test that at the moment |
|
@chancancode this is supported with the glimmer flag off https://ember-twiddle.com/cb89209f43d67d81fb74eaa59d442200?openFiles=templates.application.hbs%2C |
A quick survey in our app indicates ~77% of `PropertyReference` have a const parent. This is unsurprising, because most path lookup curlies are single-level (no dots in the path) lookup on the component directly. This means we can do less work and book-keeping in those cases (checking if the parent is a proxy on every `compute`, etc).
This avoids an extra shape transition when the component is updated.
We don’t need this anymore, see a447c48
This commit flips the responsibilities around – instead of making each reference do the work to track whether they are dealing with proxies, we can just make proxies themselves provide the right tag and do the book- keeping internally. With this change, `tagFor(proxy)` will return a tag that accounts for changes on the proxy itself as well as its content. This frees the rest of the system from worrying about that difference and removes a lot of runtime `isProxy` checks.
10dd359 to
5d17ffe
Compare
5d17ffe to
47511c3
Compare
A quick survey in our app indicates ~77% of
PropertyReferencehave a const parent. This is unsurprising, because most path lookup curlies are single-level (no dots in the path) lookup on the component directly.This means we can do less work and book-keeping in those cases (checking if the parent is a proxy on every
compute, etc).