-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[WIP] Lazy Relationships & Relationship Diffing #7521
Conversation
Asset Size Report for 95a2023 IE11 Builds ✅ EmberData shrank by -1.38 KB (-104.0 B compressed)If any packages had changed sizes they would be listed here. Changeset
Full Asset Analysis (IE11)
Modern Builds ✅ EmberData shrank by -1.24 KB (-93.0 B compressed)If any packages had changed sizes they would be listed here. Changeset
Full Asset Analysis (Modern)
Modern Builds (No Rollup) 🛑 The size of the library EmberData has increased by +3.16 KB (+790.0 B compressed) which exceeds the failure threshold of 75 bytes.WarningsChangeset
Full Asset Analysis (Modern)
|
Performance Report for 41e1bba Scenario - materialization:
|
41e1bba
to
95a2023
Compare
95a2023
to
ddc9009
Compare
somehow this auto-closed and I can't reopen it :( |
This PR aims to make BOTH the calculation of canonical state AND the calculation of current state happen on-demand (e.g. only when the UI-layer has "pulled" on the relationship to retrieve the latest state).
The deferring calculation of localState is done by changing the storage mechanism for ManyRelationship and ImplicitRelationship to a
diff
based data structure. This allows us to efficiently update the graph with better performance characteristics when an inverse changes while also avoiding the more-expensive flush of that state until the ui requests it specifically.Deferring calculation of remoteState is done via a similar mechanism to the lazy-relationships feature in 3.4. Except now, because this mechanism is built into the relationship layer directly, we have the ability to retain laziness for updates even after a relationship has been accessed for the first time. In the 3.4 version once the relationship had materialized the lazy codepaths would no longer be utilized for further updates. The benefit of this new approach is that data that was formerly displayed to the UI but now is not will not result in expensive re-calculations until it is used again.