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

[WIP] Lazy Relationships & Relationship Diffing #7521

Merged
merged 0 commits into from
Aug 17, 2022

Conversation

runspired
Copy link
Contributor

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.

@runspired runspired added 🎯 beta PR should be backported to beta 🏷️ feat This PR introduces a new feature Relationship Refactor labels May 12, 2021
@github-actions
Copy link

github-actions bot commented May 12, 2021

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


EmberData +197.82 KB -1.38 KB (+40.62 KB -104.0 B compressed)
    @ember-data/record-data +23.75 KB -1.38 KB (+4.88 KB -104.0 B compressed)
        @ember-data/record-data/-private +23.75 KB -1.38 KB (+4.88 KB -104.0 B compressed)

Full Asset Analysis (IE11)

Asset Size Report
=================


Library: EmberData
┌────────────┬─────────────┐
│  (index)   │   Values    │
├────────────┼─────────────┤
│   bytes    │ '197.82 KB' │
│ compressed │ '40.62 KB'  │
│  packages  │      8      │
│  modules   │     44      │
└────────────┴─────────────┘

Package: @ember-data/store
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '81.51 KB' │
│  compressed  │ '16.74 KB' │
│ % Of Library │   '41.2'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/store/-private                        | 80.60 KB  | 16.55 KB   | 98.9          | 40.7
	@ember-data/store/index                           | 936.00 B  | 192.18 B   | 1.1           | 0.5

Package: @ember-data/model
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '32.91 KB' │
│  compressed  │ '6.76 KB'  │
│ % Of Library │   '16.6'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/model/-private                        | 32.43 KB  | 6.66 KB    | 98.6          | 16.4
	@ember-data/model/index                           | 486.00 B  | 99.79 B    | 1.4           | 0.2

Package: @ember-data/record-data
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '23.75 KB' │
│  compressed  │ '4.88 KB'  │
│ % Of Library │   '12.0'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/record-data/-private                  | 23.75 KB  | 4.88 KB    | 100.0         | 12.0

Package: @ember-data/serializer
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '20.82 KB' │
│  compressed  │ '4.27 KB'  │
│ % Of Library │   '10.5'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/serializer/json                       | 7.75 KB   | 1.59 KB    | 37.2          | 3.9
	@ember-data/serializer/-private                   | 5.69 KB   | 1.17 KB    | 27.3          | 2.9
	@ember-data/serializer/json-api                   | 3.92 KB   | 825.21 B   | 18.9          | 2.0
	@ember-data/serializer/rest                       | 3.00 KB   | 629.95 B   | 14.4          | 1.5
	@ember-data/serializer/index                      | 258.00 B  | 52.97 B    | 1.2           | 0.1
	@ember-data/serializer/transform                  | 215.00 B  | 44.14 B    | 1.0           | 0.1

Package: @ember-data/adapter
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '18.47 KB' │
│  compressed  │ '3.79 KB'  │
│ % Of Library │   '9.3'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/adapter/rest                          | 9.31 KB   | 1.91 KB    | 50.4          | 4.7
	@ember-data/adapter/-private                      | 3.80 KB   | 799.96 B   | 20.6          | 1.9
	@ember-data/adapter/error                         | 1.95 KB   | 409.42 B   | 10.5          | 1.0
	@ember-data/adapter/index                         | 1.81 KB   | 379.85 B   | 9.8           | 0.9
	@ember-data/adapter/json-api                      | 1.60 KB   | 337.15 B   | 8.7           | 0.8

Package: ember-data
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '9.24 KB' │
│  compressed  │ '1.90 KB' │
│ % Of Library │   '4.7'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-data/index                                  | 2.32 KB   | 488.47 B   | 25.1          | 1.2
	ember-data/-private                               | 1.98 KB   | 416.61 B   | 21.4          | 1.0
	ember-data/adapters/errors                        | 1.19 KB   | 249.88 B   | 12.9          | 0.6
	ember-data/setup-container                        | 503.00 B  | 103.28 B   | 5.3           | 0.2
	ember-data/relationships                          | 318.00 B  | 65.29 B    | 3.4           | 0.2
	ember-data/serializers/embedded-records-mixin     | 274.00 B  | 56.26 B    | 2.9           | 0.1
	ember-data/serializers/json-api                   | 251.00 B  | 51.53 B    | 2.7           | 0.1
	ember-data/adapters/json-api                      | 245.00 B  | 50.30 B    | 2.6           | 0.1
	ember-data/serializers/json                       | 243.00 B  | 49.89 B    | 2.6           | 0.1
	ember-data/serializers/rest                       | 243.00 B  | 49.89 B    | 2.6           | 0.1
	ember-data/transform                              | 241.00 B  | 49.48 B    | 2.5           | 0.1
	ember-data/adapters/rest                          | 237.00 B  | 48.66 B    | 2.5           | 0.1
	ember-data/serializer                             | 232.00 B  | 47.63 B    | 2.5           | 0.1
	ember-data/adapter                                | 226.00 B  | 46.40 B    | 2.4           | 0.1
	ember-data/model                                  | 222.00 B  | 45.58 B    | 2.3           | 0.1
	ember-data/store                                  | 222.00 B  | 45.58 B    | 2.3           | 0.1
	ember-data/attr                                   | 218.00 B  | 44.76 B    | 2.3           | 0.1
	ember-data/version                                | 162.00 B  | 33.26 B    | 1.7           | 0.1

Package: ember-inflector
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '8.15 KB' │
│  compressed  │ '1.67 KB' │
│ % Of Library │   '4.1'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-inflector/lib/system/inflector              | 3.11 KB   | 653.76 B   | 38.1          | 1.6
	ember-inflector/lib/helpers/pluralize             | 1.62 KB   | 340.43 B   | 19.9          | 0.8
	ember-inflector/lib/system/inflections            | 1.59 KB   | 334.06 B   | 19.5          | 0.8
	ember-inflector/index                             | 473.00 B  | 97.12 B    | 5.7           | 0.2
	ember-inflector/lib/system                        | 471.00 B  | 96.70 B    | 5.6           | 0.2
	ember-inflector/lib/system/string                 | 332.00 B  | 68.16 B    | 4.0           | 0.2
	ember-inflector/lib/utils/make-helper             | 308.00 B  | 63.24 B    | 3.7           | 0.2
	ember-inflector/lib/helpers/singularize           | 296.00 B  | 60.77 B    | 3.5           | 0.1

Package: @ember-data/debug
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '2.96 KB'  │
│  compressed  │ '622.35 B' │
│ % Of Library │   '1.5'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/debug/index                           | 2.47 KB   | 519.68 B   | 83.5          | 1.2
	@ember-data/debug/setup                           | 500.00 B  | 102.66 B   | 16.5          | 0.2

Modern Builds

✅ EmberData shrank by -1.24 KB (-93.0 B compressed)

If any packages had changed sizes they would be listed here.

Changeset


EmberData +177.21 KB -1.24 KB (+38.65 KB -93.0 B compressed)
    @ember-data/record-data +21.96 KB -1.24 KB (+4.79 KB -93.0 B compressed)
        @ember-data/record-data/-private +21.96 KB -1.24 KB (+4.79 KB -93.0 B compressed)

Full Asset Analysis (Modern)

Asset Size Report
=================


Library: EmberData
┌────────────┬─────────────┐
│  (index)   │   Values    │
├────────────┼─────────────┤
│   bytes    │ '177.21 KB' │
│ compressed │ '38.65 KB'  │
│  packages  │      8      │
│  modules   │     44      │
└────────────┴─────────────┘

Package: @ember-data/store
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '72.01 KB' │
│  compressed  │ '15.71 KB' │
│ % Of Library │   '40.6'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/store/-private                        | 71.09 KB  | 15.51 KB   | 98.7          | 40.1
	@ember-data/store/index                           | 936.00 B  | 204.17 B   | 1.3           | 0.5

Package: @ember-data/model
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '29.28 KB' │
│  compressed  │ '6.39 KB'  │
│ % Of Library │   '16.5'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/model/-private                        | 28.81 KB  | 6.28 KB    | 98.4          | 16.3
	@ember-data/model/index                           | 486.00 B  | 106.01 B   | 1.6           | 0.3

Package: @ember-data/record-data
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '21.96 KB' │
│  compressed  │ '4.79 KB'  │
│ % Of Library │   '12.4'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/record-data/-private                  | 21.96 KB  | 4.79 KB    | 100.0         | 12.4

Package: @ember-data/serializer
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '19.34 KB' │
│  compressed  │ '4.22 KB'  │
│ % Of Library │   '10.9'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/serializer/json                       | 7.12 KB   | 1.55 KB    | 36.8          | 4.0
	@ember-data/serializer/-private                   | 5.37 KB   | 1.17 KB    | 27.8          | 3.0
	@ember-data/serializer/json-api                   | 3.69 KB   | 824.97 B   | 19.1          | 2.1
	@ember-data/serializer/rest                       | 2.71 KB   | 605.96 B   | 14.0          | 1.5
	@ember-data/serializer/index                      | 243.00 B  | 53.00 B    | 1.2           | 0.1
	@ember-data/serializer/transform                  | 215.00 B  | 46.89 B    | 1.1           | 0.1

Package: @ember-data/adapter
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '16.02 KB' │
│  compressed  │ '3.49 KB'  │
│ % Of Library │   '9.0'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/adapter/rest                          | 8.37 KB   | 1.83 KB    | 52.2          | 4.7
	@ember-data/adapter/-private                      | 3.58 KB   | 800.54 B   | 22.4          | 2.0
	@ember-data/adapter/error                         | 1.91 KB   | 427.31 B   | 11.9          | 1.1
	@ember-data/adapter/index                         | 1.14 KB   | 253.90 B   | 7.1           | 0.6
	@ember-data/adapter/json-api                      | 1.02 KB   | 227.51 B   | 6.4           | 0.6

Package: ember-data
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '9.24 KB' │
│  compressed  │ '2.02 KB' │
│ % Of Library │   '5.2'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-data/index                                  | 2.32 KB   | 518.93 B   | 25.1          | 1.3
	ember-data/-private                               | 1.98 KB   | 442.58 B   | 21.4          | 1.1
	ember-data/adapters/errors                        | 1.19 KB   | 265.46 B   | 12.9          | 0.7
	ember-data/setup-container                        | 503.00 B  | 109.72 B   | 5.3           | 0.3
	ember-data/relationships                          | 318.00 B  | 69.36 B    | 3.4           | 0.2
	ember-data/serializers/embedded-records-mixin     | 274.00 B  | 59.76 B    | 2.9           | 0.2
	ember-data/serializers/json-api                   | 251.00 B  | 54.75 B    | 2.7           | 0.1
	ember-data/adapters/json-api                      | 245.00 B  | 53.44 B    | 2.6           | 0.1
	ember-data/serializers/json                       | 243.00 B  | 53.00 B    | 2.6           | 0.1
	ember-data/serializers/rest                       | 243.00 B  | 53.00 B    | 2.6           | 0.1
	ember-data/transform                              | 241.00 B  | 52.56 B    | 2.5           | 0.1
	ember-data/adapters/rest                          | 237.00 B  | 51.69 B    | 2.5           | 0.1
	ember-data/serializer                             | 232.00 B  | 50.60 B    | 2.5           | 0.1
	ember-data/adapter                                | 226.00 B  | 49.29 B    | 2.4           | 0.1
	ember-data/model                                  | 222.00 B  | 48.42 B    | 2.3           | 0.1
	ember-data/store                                  | 222.00 B  | 48.42 B    | 2.3           | 0.1
	ember-data/attr                                   | 218.00 B  | 47.55 B    | 2.3           | 0.1
	ember-data/version                                | 162.00 B  | 35.33 B    | 1.7           | 0.1

Package: ember-inflector
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '6.66 KB' │
│  compressed  │ '1.45 KB' │
│ % Of Library │   '3.8'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-inflector/lib/system/inflector              | 2.88 KB   | 643.26 B   | 43.3          | 1.6
	ember-inflector/lib/system/inflections            | 1.59 KB   | 354.89 B   | 23.9          | 0.9
	ember-inflector/index                             | 473.00 B  | 103.17 B   | 6.9           | 0.3
	ember-inflector/lib/system                        | 471.00 B  | 102.73 B   | 6.9           | 0.3
	ember-inflector/lib/helpers/pluralize             | 373.00 B  | 81.36 B    | 5.5           | 0.2
	ember-inflector/lib/system/string                 | 318.00 B  | 69.36 B    | 4.7           | 0.2
	ember-inflector/lib/utils/make-helper             | 308.00 B  | 67.18 B    | 4.5           | 0.2
	ember-inflector/lib/helpers/singularize           | 296.00 B  | 64.56 B    | 4.3           | 0.2

Package: @ember-data/debug
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '2.70 KB'  │
│  compressed  │ '603.13 B' │
│ % Of Library │   '1.5'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/debug/index                           | 2.21 KB   | 494.28 B   | 82.0          | 1.2
	@ember-data/debug/setup                           | 499.00 B  | 108.84 B   | 18.0          | 0.3

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.

Warnings

⚠️ The uncompressed size of the package @ember-data/record-data has increased by +3.16 KB.

Changeset


EmberData +221.25 KB +3.16 KB (+42.83 KB +790.0 B compressed)
    @ember-data/record-data +33.13 KB +3.16 KB (+6.41 KB +790.0 B compressed)
        @ember-data/record-data/-private/graph/index +4.54 KB -68.0 B (+900.75 B -16.6 B compressed)
        @ember-data/record-data/-private/graph/operations/replace-related-records +3.21 KB +212.0 B (+637.28 B +51.74 B compressed)
        @ember-data/record-data/-private/relationships/state/has-many +876.0 B -1.12 KB (+169.58 B -278.95 B compressed)
        @ember-data/record-data/-private/relationships/state/belongs-to +843.0 B -1.08 KB (+163.19 B -269.43 B compressed)
        @ember-data/record-data/-private/graph/operations/update-relationship +1.39 KB -26.0 B (+275.86 B -6.35 B compressed)
        @ember-data/record-data/-private/graph/-utils +2.66 KB +1.63 KB (+527.52 B +406.84 B compressed)
        @ember-data/record-data/-private/graph/operations/replace-related-record +1.0 KB +50.0 B (+199.2 B +12.2 B compressed)
        @ember-data/record-data/-private/graph/operations/add-to-related-records +790.0 B +19.0 B (+152.93 B +4.64 B compressed)
        @ember-data/record-data/-private/relationships/state/implicit +374.0 B -318.0 B (+72.4 B -77.61 B compressed)
        @ember-data/record-data/-private/graph/operations/remove-from-related-records +669.0 B +19.0 B (+129.5 B +4.64 B compressed)
        @ember-data/record-data/-private/graph/membership +3.84 KB +3.84 KB (+760.6 B +958.88 B compressed)

Full Asset Analysis (Modern)

Asset Size Report
=================


Library: EmberData
┌────────────┬─────────────┐
│  (index)   │   Values    │
├────────────┼─────────────┤
│   bytes    │ '221.25 KB' │
│ compressed │ '42.83 KB'  │
│  packages  │      8      │
│  modules   │     150     │
└────────────┴─────────────┘

Package: @ember-data/store
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '95.53 KB' │
│  compressed  │ '18.49 KB' │
│ % Of Library │   '43.2'   │
└──────────────┴────────────┘
	Module                                                                             | Bytes     | Compressed | % of Package  | % Of Library
	--------------------------------------------------------------------------------------------------------------------------------------
	@ember-data/store/-private/system/core-store                                       | 17.10 KB  | 3.31 KB    | 17.9          | 7.7
	@ember-data/store/-private/system/model/internal-model                             | 14.33 KB  | 2.78 KB    | 15.0          | 6.5
	@ember-data/store/-private/system/model/states                                     | 5.42 KB   | 1.05 KB    | 5.7           | 2.5
	@ember-data/store/-private/system/fetch-manager                                    | 5.00 KB   | 990.77 B   | 5.2           | 2.3
	@ember-data/store/-private/system/store/finders                                    | 4.49 KB   | 889.52 B   | 4.7           | 2.0
	@ember-data/store/-private/system/record-array-manager                             | 4.11 KB   | 814.80 B   | 4.3           | 1.9
	@ember-data/store/-private/identifiers/cache                                       | 3.88 KB   | 768.34 B   | 4.1           | 1.8
	@ember-data/store/-private/index                                                   | 3.57 KB   | 707.55 B   | 3.7           | 1.6
	@ember-data/store/-private/system/store/record-data-store-wrapper                  | 3.36 KB   | 665.74 B   | 3.5           | 1.5
	@ember-data/store/-private/system/snapshot                                         | 3.21 KB   | 635.54 B   | 3.4           | 1.4
	@ember-data/store/-private/system/store/internal-model-factory                     | 2.91 KB   | 577.66 B   | 3.1           | 1.3
	@ember-data/store/-private/system/record-arrays/record-array                       | 2.25 KB   | 445.82 B   | 2.4           | 1.0
	@ember-data/store/-private/system/request-cache                                    | 1.89 KB   | 373.81 B   | 2.0           | 0.9
	@ember-data/store/-private/system/ds-model-store                                   | 1.85 KB   | 367.42 B   | 1.9           | 0.8
	@ember-data/store/-private/system/references/has-many                              | 1.53 KB   | 303.15 B   | 1.6           | 0.7
	@ember-data/store/-private/system/schema-definition-service                        | 1.47 KB   | 292.12 B   | 1.5           | 0.7
	@ember-data/store/-private/system/model/shim-model-class                           | 1.32 KB   | 261.14 B   | 1.4           | 0.6
	@ember-data/store/-private/system/references/belongs-to                            | 1.30 KB   | 258.24 B   | 1.4           | 0.6
	@ember-data/store/-private/system/store/serializer-response                        | 1.12 KB   | 222.81 B   | 1.2           | 0.5
	@ember-data/store/-private/identifiers/utils/uuid-v4                               | 1.05 KB   | 208.68 B   | 1.1           | 0.5
	@ember-data/store/-private/system/references/record                                | 979.00 B  | 189.52 B   | 1.0           | 0.4
	@ember-data/store/index                                                            | 936.00 B  | 181.19 B   | 1.0           | 0.4
	@ember-data/store/-private/system/references/reference                             | 917.00 B  | 177.51 B   | 0.9           | 0.4
	@ember-data/store/-private/system/record-arrays/adapter-populated-record-array     | 892.00 B  | 172.67 B   | 0.9           | 0.4
	@ember-data/store/-private/system/internal-model-map                               | 869.00 B  | 168.22 B   | 0.9           | 0.4
	@ember-data/store/-private/system/errors-utils                                     | 764.00 B  | 147.90 B   | 0.8           | 0.3
	@ember-data/store/-private/system/snapshot-record-array                            | 753.00 B  | 145.77 B   | 0.8           | 0.3
	@ember-data/store/-private/system/record-notification-manager                      | 697.00 B  | 134.92 B   | 0.7           | 0.3
	@ember-data/store/-private/system/references                                       | 598.00 B  | 115.76 B   | 0.6           | 0.3
	@ember-data/store/-private/system/promise-proxies                                  | 556.00 B  | 107.63 B   | 0.6           | 0.2
	@ember-data/store/-private/utils/construct-resource                                | 506.00 B  | 97.95 B    | 0.5           | 0.2
	@ember-data/store/-private/system/store/common                                     | 505.00 B  | 97.76 B    | 0.5           | 0.2
	@ember-data/store/-private/system/coerce-id                                        | 496.00 B  | 96.01 B    | 0.5           | 0.2
	@ember-data/store/-private/system/record-arrays                                    | 487.00 B  | 94.27 B    | 0.5           | 0.2
	@ember-data/store/-private/system/identity-map                                     | 450.00 B  | 87.11 B    | 0.5           | 0.2
	@ember-data/store/-private/ts-interfaces/identifier                                | 400.00 B  | 77.43 B    | 0.4           | 0.2
	@ember-data/store/-private/utils/symbol                                            | 393.00 B  | 76.07 B    | 0.4           | 0.2
	@ember-data/store/-private/system/record-data-for                                  | 373.00 B  | 72.20 B    | 0.4           | 0.2
	@ember-data/store/-private/identifiers/is-stable-identifier                        | 327.00 B  | 63.30 B    | 0.3           | 0.1
	@ember-data/store/-private/ts-interfaces/fetch-manager                             | 316.00 B  | 61.17 B    | 0.3           | 0.1
	@ember-data/store/-private/utils/promise-record                                    | 290.00 B  | 56.14 B    | 0.3           | 0.1
	@ember-data/store/-private/system/backburner                                       | 239.00 B  | 46.26 B    | 0.2           | 0.1
	@ember-data/store/-private/system/normalize-model-name                             | 220.00 B  | 42.58 B    | 0.2           | 0.1
	@ember-data/store/-private/utils/is-non-empty-string                               | 212.00 B  | 41.04 B    | 0.2           | 0.1
	@ember-data/store/-debug/index                                                     | 193.00 B  | 37.36 B    | 0.2           | 0.1
	@ember-data/store/-private/system/deprecated-evented                               | 190.00 B  | 36.78 B    | 0.2           | 0.1
	@ember-data/store/-private/ts-interfaces/minimum-serializer-interface              | 98.00 B   | 18.97 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/record-data-record-wrapper                | 96.00 B   | 18.58 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/minimum-adapter-interface                 | 95.00 B   | 18.39 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/record-data-store-wrapper                 | 95.00 B   | 18.39 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/schema-definition-service                 | 95.00 B   | 18.39 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/record-data-json-api                      | 90.00 B   | 17.42 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/ember-data-json-api                       | 89.00 B   | 17.22 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/record-data-schemas                       | 89.00 B   | 17.22 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/promise-proxies                           | 85.00 B   | 16.45 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/record-instance                           | 85.00 B   | 16.45 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/record-data                               | 81.00 B   | 15.68 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/ds-model                                  | 78.00 B   | 15.09 B    | 0.1           | 0.0
	@ember-data/store/-private/ts-interfaces/utils                                     | 75.00 B   | 14.51 B    | 0.1           | 0.0

Package: @ember-data/model
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '33.85 KB' │
│  compressed  │ '6.55 KB'  │
│ % Of Library │   '15.3'   │
└──────────────┴────────────┘
	Module                                                                | Bytes     | Compressed | % of Package  | % Of Library
	-------------------------------------------------------------------------------------------------------------------------
	@ember-data/model/-private/model                                      | 9.99 KB   | 1.93 KB    | 29.5          | 4.5
	@ember-data/model/-private/record-state                               | 6.40 KB   | 1.24 KB    | 18.9          | 2.9
	@ember-data/model/-private/system/promise-many-array                  | 4.08 KB   | 808.03 B   | 12.0          | 1.8
	@ember-data/model/-private/system/many-array                          | 2.78 KB   | 551.91 B   | 8.2           | 1.3
	@ember-data/model/-private/errors                                     | 2.03 KB   | 403.04 B   | 6.0           | 0.9
	@ember-data/model/-private/index                                      | 1.42 KB   | 281.86 B   | 4.2           | 0.6
	@ember-data/model/-private/system/relationships/relationship-meta     | 1.25 KB   | 248.37 B   | 3.7           | 0.6
	@ember-data/model/-private/tmp-cached-polyfill                        | 1000.00 B | 193.58 B   | 2.9           | 0.4
	@ember-data/model/-private/attr                                       | 823.00 B  | 159.32 B   | 2.4           | 0.4
	@ember-data/model/-private/notify-changes                             | 817.00 B  | 158.16 B   | 2.4           | 0.4
	@ember-data/model/-private/belongs-to                                 | 626.00 B  | 121.18 B   | 1.8           | 0.3
	@ember-data/model/-private/has-many                                   | 587.00 B  | 113.63 B   | 1.7           | 0.3
	@ember-data/model/index                                               | 486.00 B  | 94.08 B    | 1.4           | 0.2
	@ember-data/model/-private/util                                       | 442.00 B  | 85.56 B    | 1.3           | 0.2
	@ember-data/model/-private/system/diff-array                          | 438.00 B  | 84.79 B    | 1.3           | 0.2
	@ember-data/model/-private/system/promise-belongs-to                  | 412.00 B  | 79.75 B    | 1.2           | 0.2
	@ember-data/model/-private/system/model-for-mixin                     | 408.00 B  | 78.98 B    | 1.2           | 0.2

Package: @ember-data/record-data
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '33.13 KB' │
│  compressed  │ '6.41 KB'  │
│ % Of Library │   '15.0'   │
└──────────────┴────────────┘
	Module                                                                            | Bytes     | Compressed | % of Package  | % Of Library
	-------------------------------------------------------------------------------------------------------------------------------------
	@ember-data/record-data/-private/record-data                                      | 8.16 KB   | 1.58 KB    | 24.6          | 3.7
	@ember-data/record-data/-private/graph/index                                      | 4.54 KB   | 900.75 B   | 13.7          | 2.1
	@ember-data/record-data/-private/graph/membership                                 | 3.84 KB   | 760.60 B   | 11.6          | 1.7
	@ember-data/record-data/-private/graph/operations/replace-related-records         | 3.21 KB   | 637.28 B   | 9.7           | 1.5
	@ember-data/record-data/-private/graph/-edge-definition                           | 2.81 KB   | 556.75 B   | 8.5           | 1.3
	@ember-data/record-data/-private/graph/-utils                                     | 2.66 KB   | 527.52 B   | 8.0           | 1.2
	@ember-data/record-data/-private/graph/operations/update-relationship             | 1.39 KB   | 275.86 B   | 4.2           | 0.6
	@ember-data/record-data/-private/graph/operations/replace-related-record          | 1.00 KB   | 199.20 B   | 3.0           | 0.5
	@ember-data/record-data/-private/index                                            | 977.00 B  | 189.13 B   | 2.9           | 0.4
	@ember-data/record-data/-private/relationships/state/has-many                     | 876.00 B  | 169.58 B   | 2.6           | 0.4
	@ember-data/record-data/-private/relationships/state/belongs-to                   | 843.00 B  | 163.19 B   | 2.5           | 0.4
	@ember-data/record-data/-private/graph/operations/add-to-related-records          | 790.00 B  | 152.93 B   | 2.3           | 0.3
	@ember-data/record-data/-private/graph/operations/remove-from-related-records     | 669.00 B  | 129.50 B   | 2.0           | 0.3
	@ember-data/record-data/-private/coerce-id                                        | 406.00 B  | 78.59 B    | 1.2           | 0.2
	@ember-data/record-data/-private/relationships/state/implicit                     | 374.00 B  | 72.40 B    | 1.1           | 0.2
	@ember-data/record-data/-private/graph/-state                                     | 293.00 B  | 56.72 B    | 0.9           | 0.1
	@ember-data/record-data/-private/normalize-link                                   | 238.00 B  | 46.07 B    | 0.7           | 0.1
	@ember-data/record-data/-private/ts-interfaces/relationship-record-data           | 100.00 B  | 19.35 B    | 0.3           | 0.0
	@ember-data/record-data/-private/graph/-operations                                | 79.00 B   | 15.29 B    | 0.2           | 0.0

Package: @ember-data/serializer
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '21.74 KB' │
│  compressed  │ '4.21 KB'  │
│ % Of Library │   '9.8'    │
└──────────────┴────────────┘
	Module                                                     | Bytes     | Compressed | % of Package  | % Of Library
	--------------------------------------------------------------------------------------------------------------
	@ember-data/serializer/json                                | 7.12 KB   | 1.38 KB    | 32.7          | 3.2
	@ember-data/serializer/-private/embedded-records-mixin     | 4.30 KB   | 852.16 B   | 19.8          | 1.9
	@ember-data/serializer/json-api                            | 3.69 KB   | 732.14 B   | 17.0          | 1.7
	@ember-data/serializer/rest                                | 2.71 KB   | 537.78 B   | 12.5          | 1.2
	@ember-data/serializer/-private/index                      | 1.18 KB   | 234.23 B   | 5.4           | 0.5
	@ember-data/serializer/-private/transforms/date            | 523.00 B  | 101.24 B   | 2.3           | 0.2
	@ember-data/serializer/-private/transforms/boolean         | 490.00 B  | 94.85 B    | 2.2           | 0.2
	@ember-data/serializer/-private/transforms/number          | 446.00 B  | 86.33 B    | 2.0           | 0.2
	@ember-data/serializer/-private/transforms/string          | 351.00 B  | 67.94 B    | 1.6           | 0.2
	@ember-data/serializer/-private/utils                      | 286.00 B  | 55.36 B    | 1.3           | 0.1
	@ember-data/serializer/index                               | 243.00 B  | 47.04 B    | 1.1           | 0.1
	@ember-data/serializer/-private/transforms/transform       | 242.00 B  | 46.84 B    | 1.1           | 0.1
	@ember-data/serializer/transform                           | 215.00 B  | 41.62 B    | 1.0           | 0.1

Package: @ember-data/adapter
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '18.14 KB' │
│  compressed  │ '3.51 KB'  │
│ % Of Library │   '8.2'    │
└──────────────┴────────────┘
	Module                                                        | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------------------
	@ember-data/adapter/rest                                      | 8.37 KB   | 1.62 KB    | 46.1          | 3.8
	@ember-data/adapter/error                                     | 1.91 KB   | 379.23 B   | 10.5          | 0.9
	@ember-data/adapter/-private/build-url-mixin                  | 1.82 KB   | 361.42 B   | 10.1          | 0.8
	@ember-data/adapter/index                                     | 1.14 KB   | 225.33 B   | 6.3           | 0.5
	@ember-data/adapter/-private/index                            | 1.03 KB   | 204.42 B   | 5.7           | 0.5
	@ember-data/adapter/json-api                                  | 1.02 KB   | 201.91 B   | 5.6           | 0.5
	@ember-data/adapter/-private/utils/serialize-query-params     | 792.00 B  | 153.32 B   | 4.3           | 0.3
	@ember-data/adapter/-private/utils/determine-body-promise     | 549.00 B  | 106.27 B   | 3.0           | 0.2
	@ember-data/adapter/-private/utils/parse-response-headers     | 480.00 B  | 92.92 B    | 2.6           | 0.2
	@ember-data/adapter/-private/utils/fetch                      | 454.00 B  | 87.88 B    | 2.4           | 0.2
	@ember-data/adapter/-private/utils/serialize-into-hash        | 347.00 B  | 67.17 B    | 1.9           | 0.2
	@ember-data/adapter/-private/utils/continue-on-reject         | 219.00 B  | 42.39 B    | 1.2           | 0.1
	@ember-data/adapter/-private/fastboot-interface               | 76.00 B   | 14.71 B    | 0.4           | 0.0

Package: ember-data
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '9.50 KB' │
│  compressed  │ '1.84 KB' │
│ % Of Library │   '4.3'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-data/index                                  | 2.32 KB   | 460.53 B   | 24.5          | 1.1
	ember-data/-private/index                         | 1.93 KB   | 382.13 B   | 20.3          | 0.9
	ember-data/adapters/errors                        | 1.19 KB   | 235.59 B   | 12.5          | 0.5
	ember-data/setup-container                        | 503.00 B  | 97.37 B    | 5.2           | 0.2
	ember-data/-private/core                          | 321.00 B  | 62.14 B    | 3.3           | 0.1
	ember-data/relationships                          | 318.00 B  | 61.56 B    | 3.3           | 0.1
	ember-data/serializers/embedded-records-mixin     | 274.00 B  | 53.04 B    | 2.8           | 0.1
	ember-data/serializers/json-api                   | 251.00 B  | 48.58 B    | 2.6           | 0.1
	ember-data/adapters/json-api                      | 245.00 B  | 47.42 B    | 2.5           | 0.1
	ember-data/serializers/json                       | 243.00 B  | 47.04 B    | 2.5           | 0.1
	ember-data/serializers/rest                       | 243.00 B  | 47.04 B    | 2.5           | 0.1
	ember-data/transform                              | 241.00 B  | 46.65 B    | 2.5           | 0.1
	ember-data/adapters/rest                          | 237.00 B  | 45.87 B    | 2.4           | 0.1
	ember-data/serializer                             | 232.00 B  | 44.91 B    | 2.4           | 0.1
	ember-data/adapter                                | 226.00 B  | 43.75 B    | 2.3           | 0.1
	ember-data/model                                  | 222.00 B  | 42.97 B    | 2.3           | 0.1
	ember-data/store                                  | 222.00 B  | 42.97 B    | 2.3           | 0.1
	ember-data/attr                                   | 218.00 B  | 42.20 B    | 2.2           | 0.1
	ember-data/version                                | 162.00 B  | 31.36 B    | 1.7           | 0.1

Package: ember-inflector
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '6.66 KB' │
│  compressed  │ '1.29 KB' │
│ % Of Library │   '3.0'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-inflector/lib/system/inflector              | 2.88 KB   | 570.88 B   | 43.3          | 1.3
	ember-inflector/lib/system/inflections            | 1.59 KB   | 314.96 B   | 23.9          | 0.7
	ember-inflector/index                             | 473.00 B  | 91.56 B    | 6.9           | 0.2
	ember-inflector/lib/system                        | 471.00 B  | 91.17 B    | 6.9           | 0.2
	ember-inflector/lib/helpers/pluralize             | 373.00 B  | 72.20 B    | 5.5           | 0.2
	ember-inflector/lib/system/string                 | 318.00 B  | 61.56 B    | 4.7           | 0.1
	ember-inflector/lib/utils/make-helper             | 308.00 B  | 59.62 B    | 4.5           | 0.1
	ember-inflector/lib/helpers/singularize           | 296.00 B  | 57.30 B    | 4.3           | 0.1

Package: @ember-data/debug
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '2.70 KB'  │
│  compressed  │ '535.26 B' │
│ % Of Library │   '1.2'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/debug/index                           | 2.21 KB   | 438.66 B   | 82.0          | 1.0
	@ember-data/debug/setup                           | 499.00 B  | 96.59 B    | 18.0          | 0.2

@github-actions
Copy link

Performance Report for 41e1bba

Scenario - materialization: ⚠️ Performance regressed

⚠️ duration
phase estimated regression +36ms [9ms to 60ms] OR +1.4% [0.37% to 2.35%]
☑️ Phase [navigationStart] => [start-find-all]
phase no difference [-2ms to 20ms]
☑️ Phase [start-find-all] => [start-materialization]
phase no difference [-3ms to 29ms]
✅ Phase [start-materialization] => [end-materialization]
phase estimated improvement -20ms [-33ms to -7ms] OR -2.12% [-3.58% to -0.74%]
⚠️ Phase [end-materialization] => [Test End]
phase estimated regression +33ms [27ms to 38ms] OR +35.58% [29.68% to 41.36%]

Scenario - unload: ⚠️ Performance regressed

⚠️ duration
phase estimated regression +82ms [44ms to 115ms] OR +1.25% [0.68% to 1.77%]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-16ms to 7ms]
⚠️ Phase [start-push-payload] => [start-unload-records]
phase estimated regression +54ms [38ms to 72ms] OR +3.2% [2.24% to 4.22%]
⚠️ Phase [start-unload-records] => [end-unload-records]
phase estimated regression +27ms [2ms to 55ms] OR +0.7% [0.06% to 1.39%]
☑️ Phase [end-unload-records] => [Test End]
phase no difference [-4ms to 1ms]

Scenario - destroy: ☑️ Performance is stable

☑️ duration
phase no difference [-25ms to 87ms]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-11ms to 18ms]
⚠️ Phase [start-push-payload] => [start-destroy-records]
phase estimated regression +32ms [5ms to 61ms] OR +1.8% [0.26% to 3.44%]
☑️ Phase [start-destroy-records] => [end-destroy-records]
phase no difference [-33ms to 21ms]
☑️ Phase [end-destroy-records] => [Test End]
phase no difference [-2ms to 5ms]

Scenario - add-children: ☑️ Performance is stable

☑️ duration
phase no difference [-35ms to 10ms]
☑️ Phase [navigationStart] => [start-push-initial-payload]
phase no difference [-16ms to 14ms]
☑️ Phase [start-push-initial-payload] => [start-push-update-payload]
phase no difference [-7ms to 19ms]
✅ Phase [start-push-update-payload] => [end-push-update-payload]
phase estimated improvement -8ms [-14ms to -2ms] OR -3.1% [-5.45% to -0.77%]
✅ Phase [end-push-update-payload] => [Test End]
phase estimated improvement -4ms [-9ms to 0ms] OR -2.87% [-6.15% to -0.16%]

Scenario - unused-relationships: ⚠️ Performance regressed

⚠️ duration
phase estimated regression +58ms [27ms to 88ms] OR +2.09% [0.96% to 3.16%]
⚠️ Phase [navigationStart] => [start-push-payload]
phase estimated regression +13ms [0ms to 27ms] OR +1.62% [0.03% to 3.29%]
⚠️ Phase [start-push-payload] => [end-push-payload]
phase estimated regression +48ms [22ms to 72ms] OR +2.68% [1.23% to 4%]
☑️ Phase [end-push-payload] => [Test End]
phase no difference [-7ms to 2ms]

@runspired runspired force-pushed the runspired/fast-relationships branch from 41e1bba to 95a2023 Compare May 12, 2021 20:50
@runspired runspired added 🏷️ perf PRs that improve performance in a notable way and removed 🏷️ feat This PR introduces a new feature performance 🎯 beta PR should be backported to beta labels May 27, 2021
@runspired runspired mentioned this pull request Aug 16, 2022
6 tasks
@runspired runspired merged commit ddc9009 into master Aug 17, 2022
@delete-merged-branch delete-merged-branch bot deleted the runspired/fast-relationships branch August 17, 2022 03:00
@runspired runspired restored the runspired/fast-relationships branch August 17, 2022 06:14
@runspired
Copy link
Contributor Author

somehow this auto-closed and I can't reopen it :(

@runspired runspired temporarily deployed to deployment August 17, 2022 20:14 Inactive
@runspired runspired mentioned this pull request Aug 28, 2023
5 tasks
@runspired runspired added this to the Public Graph API milestone Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 Roadmap 🏷️ perf PRs that improve performance in a notable way
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

1 participant