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

feat: deprecate proxies (implements emberjs/rfcs#846) #8134

Merged
merged 2 commits into from
Aug 25, 2022

Conversation

runspired
Copy link
Contributor

@runspired runspired commented Aug 18, 2022

  • implement proxy based RecordArray
  • implement proxy based AdapterPopulatedRecordArray
  • implement proxy based ManyArray
  • add code-stripping for deprecated promise proxies
  • add code-stripping for deprecated array-like
  • add deprecations to promise proxies
  • add deprecations to array-like
  • add deprecations for setting values to promises/proxies
  • investigate/fix perf (proxies are hard)

Based on prior analysis, I would expect a small increase in core size once this is complete (to account for not importing and using something from ember) along the lines of .2 KB compressed, but with a significant reduction in the cost of updating and materializing record-arrays and relationships.

@runspired runspired added 🎯 canary PR is targeting canary (default) 🏷️ deprecation 5.0 Roadmap labels Aug 18, 2022
@runspired runspired added 🌲 Project Trim 🌲 PRs related to https://github.com/emberjs/data/issues/6166 🔌 Project Unplug 🔌 labels Aug 18, 2022
@github-actions
Copy link

github-actions bot commented Aug 18, 2022

Performance Report for 14551ec

Scenario - basic-record-materialization: ☑️ Performance is stable

☑️ duration
phase no difference [-6ms to 42ms]
☑️ Phase [navigationStart] => [start-data-generation]
phase no difference [-3ms to 2ms]
☑️ Phase [start-data-generation] => [start-push-payload]
phase no difference [-1ms to 3ms]
☑️ Phase [start-push-payload] => [start-peek-records]
phase no difference [-22ms to 3ms]
☑️ Phase [start-peek-records] => [start-record-materialization]
phase no difference [-1ms to 0ms]
⚠️ Phase [start-record-materialization] => [end-record-materialization]
phase estimated regression +20ms [9ms to 32ms] OR +2.42% [1.03% to 3.81%]
⚠️ Phase [end-record-materialization] => [Test End]
phase estimated regression +4ms [0ms to 13ms] OR +6.08% [0.39% to 19.08%]

Scenario - relationship-materialization-simple: ✅ Performance improved

✅ duration
phase estimated improvement -296ms [-307ms to -285ms] OR -28.11% [-29.12% to -27.06%]
☑️ Phase [navigationStart] => [start-find-all]
phase no difference [-1ms to 6ms]
⚠️ Phase [start-find-all] => [start-materialization]
phase estimated regression +8ms [5ms to 12ms] OR +2.12% [1.31% to 3.09%]
✅ Phase [start-materialization] => [end-materialization]
phase estimated improvement -239ms [-242ms to -237ms] OR -76.16% [-76.94% to -75.35%]
✅ Phase [end-materialization] => [Test End]
phase estimated improvement -69ms [-71ms to -68ms] OR -67.12% [-68.47% to -65.59%]

Scenario - relationship-materialization-complex: ☑️ Performance is stable

☑️ duration
phase no difference [-7ms to 48ms]
☑️ Phase [navigationStart] => [start-data-generation]
phase no difference [-3ms to 2ms]
☑️ Phase [start-data-generation] => [start-push-payload]
phase no difference [-1ms to 1ms]
☑️ Phase [start-push-payload] => [start-peek-records]
phase no difference [-4ms to 6ms]
✅ Phase [start-peek-records] => [start-record-materialization]
phase estimated improvement -1ms [-1ms to -1ms] OR -20.5% [-21.8% to -19.13%]
☑️ Phase [start-record-materialization] => [start-relationship-materialization]
phase no difference [-2ms to 4ms]
☑️ Phase [start-relationship-materialization] => [end-relationship-materialization]
phase no difference [-33ms to 12ms]
⚠️ Phase [end-relationship-materialization] => [Test End]
phase estimated regression +28ms [22ms to 32ms] OR +7.83% [6.34% to 9.23%]

Scenario - unload: ☑️ Performance is stable

☑️ duration
phase no difference [-5ms to 13ms]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-7ms to 1ms]
⚠️ Phase [start-push-payload] => [start-unload-records]
phase estimated regression +6ms [2ms to 10ms] OR +1.16% [0.42% to 1.8%]
☑️ Phase [start-unload-records] => [end-unload-records]
phase no difference [-1ms to 2ms]
☑️ Phase [end-unload-records] => [Test End]
phase no difference [0ms to 0ms]

Scenario - unload-all: ☑️ Performance is stable

☑️ duration
phase no difference [0ms to 25ms]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-2ms to 5ms]
☑️ Phase [start-push-payload] => [start-materialization]
phase no difference [-9ms to 3ms]
☑️ Phase [start-materialization] => [start-unload-all]
phase no difference [-1ms to 6ms]
⚠️ Phase [start-unload-all] => [end-unload-all]
phase estimated regression +9ms [6ms to 13ms] OR +2.77% [1.82% to 3.78%]
☑️ Phase [end-unload-all] => [Test End]
phase no difference [0ms to 0ms]

Scenario - destroy: ☑️ Performance is stable

☑️ duration
phase no difference [-10ms to 11ms]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-5ms to 3ms]
☑️ Phase [start-push-payload] => [start-destroy-records]
phase no difference [-3ms to 6ms]
☑️ Phase [start-destroy-records] => [end-destroy-records]
phase no difference [-1ms to 3ms]
☑️ Phase [end-destroy-records] => [Test End]
phase no difference [0ms to 0ms]

Scenario - add-children: ☑️ Performance is stable

☑️ duration
phase no difference [-8ms to 7ms]
☑️ Phase [navigationStart] => [start-push-initial-payload]
phase no difference [-5ms to 6ms]
☑️ Phase [start-push-initial-payload] => [start-push-update-payload]
phase no difference [-2ms to 1ms]
☑️ Phase [start-push-update-payload] => [end-push-update-payload]
phase no difference [-3ms to 1ms]
☑️ Phase [end-push-update-payload] => [Test End]
phase no difference [0ms to 0ms]

Scenario - unused-relationships: ☑️ Performance is stable

☑️ duration
phase no difference [-11ms to 5ms]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-4ms to 2ms]
☑️ Phase [start-push-payload] => [end-push-payload]
phase no difference [-3ms to 5ms]
☑️ Phase [end-push-payload] => [Test End]
phase no difference [0ms to 0ms]

@github-actions
Copy link

github-actions bot commented Aug 20, 2022

Asset Size Report for 14551ec

Modern Builds

🛑 The size of the library EmberData has increased by +1.19 KB (+558.0 B compressed) which exceeds the failure threshold of 75 bytes.

Warnings

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

Changeset


EmberData +168.28 KB +1.19 KB (+35.66 KB +558.0 B compressed)
    @ember-data/store +46.99 KB +1.75 KB (+9.96 KB +825.05 B compressed)
        @ember-data/store/-private +46.0 KB +1.75 KB (+9.75 KB +825.05 B compressed)
    @ember-data/model +44.85 KB -394.0 B (+9.5 KB -181.1 B compressed)
        @ember-data/model/-private +44.37 KB -394.0 B (+9.4 KB -181.1 B compressed)
    @ember-data/record-data +22.33 KB +46.0 B (+4.73 KB +21.14 B compressed)
        @ember-data/record-data/-private +22.33 KB +46.0 B (+4.73 KB +21.14 B compressed)
    ember-data +8.32 KB -233.0 B (+1.76 KB -107.1 B compressed)
        ember-data/index +1.98 KB -94.0 B (+430.56 B -43.21 B compressed)
        ember-data/-private +1.53 KB -139.0 B (+332.88 B -63.89 B compressed)

Full Asset Analysis (Modern)

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


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

Package: @ember-data/store
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '46.99 KB' │
│  compressed  │ '9.96 KB'  │
│ % Of Library │   '27.9'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/store/-private                        | 46.00 KB  | 9.75 KB    | 97.9          | 27.3
	@ember-data/store/index                           | 1022.00 B | 216.55 B   | 2.1           | 0.6

Package: @ember-data/model
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '44.85 KB' │
│  compressed  │ '9.50 KB'  │
│ % Of Library │   '26.7'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/model/-private                        | 44.37 KB  | 9.40 KB    | 98.9          | 26.4
	@ember-data/model/index                           | 486.00 B  | 102.98 B   | 1.1           | 0.3

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

Package: @ember-data/serializer
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '20.42 KB' │
│  compressed  │ '4.33 KB'  │
│ % Of Library │   '12.1'   │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/serializer/json                       | 7.36 KB   | 1.56 KB    | 36.0          | 4.4
	@ember-data/serializer/-private                   | 5.60 KB   | 1.19 KB    | 27.4          | 3.3
	@ember-data/serializer/json-api                   | 3.79 KB   | 822.36 B   | 18.6          | 2.3
	@ember-data/serializer/rest                       | 2.87 KB   | 621.70 B   | 14.0          | 1.7
	@ember-data/serializer/index                      | 611.00 B  | 129.46 B   | 2.9           | 0.4
	@ember-data/serializer/transform                  | 215.00 B  | 45.55 B    | 1.0           | 0.1

Package: @ember-data/adapter
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '15.93 KB' │
│  compressed  │ '3.38 KB'  │
│ % Of Library │   '9.5'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/adapter/rest                          | 7.88 KB   | 1.67 KB    | 49.5          | 4.7
	@ember-data/adapter/-private                      | 3.79 KB   | 821.30 B   | 23.8          | 2.2
	@ember-data/adapter/error                         | 1.82 KB   | 395.39 B   | 11.4          | 1.1
	@ember-data/adapter/index                         | 1.41 KB   | 306.40 B   | 8.9           | 0.8
	@ember-data/adapter/json-api                      | 1.03 KB   | 224.39 B   | 6.5           | 0.6

Package: ember-data
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '8.32 KB' │
│  compressed  │ '1.76 KB' │
│ % Of Library │   '4.9'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-data/index                                  | 1.98 KB   | 430.56 B   | 23.8          | 1.2
	ember-data/-private                               | 1.53 KB   | 332.88 B   | 18.4          | 0.9
	ember-data/adapters/errors                        | 1.19 KB   | 257.87 B   | 14.3          | 0.7
	ember-data/setup-container                        | 368.00 B  | 77.97 B    | 4.3           | 0.2
	ember-data/relationships                          | 318.00 B  | 67.38 B    | 3.7           | 0.2
	ember-data/serializers/embedded-records-mixin     | 274.00 B  | 58.05 B    | 3.2           | 0.2
	ember-data/serializers/json-api                   | 251.00 B  | 53.18 B    | 2.9           | 0.1
	ember-data/adapters/json-api                      | 245.00 B  | 51.91 B    | 2.9           | 0.1
	ember-data/serializers/json                       | 243.00 B  | 51.49 B    | 2.9           | 0.1
	ember-data/serializers/rest                       | 243.00 B  | 51.49 B    | 2.9           | 0.1
	ember-data/transform                              | 241.00 B  | 51.06 B    | 2.8           | 0.1
	ember-data/adapters/rest                          | 237.00 B  | 50.21 B    | 2.8           | 0.1
	ember-data/serializer                             | 232.00 B  | 49.15 B    | 2.7           | 0.1
	ember-data/adapter                                | 226.00 B  | 47.88 B    | 2.7           | 0.1
	ember-data/model                                  | 222.00 B  | 47.04 B    | 2.6           | 0.1
	ember-data/store                                  | 222.00 B  | 47.04 B    | 2.6           | 0.1
	ember-data/attr                                   | 218.00 B  | 46.19 B    | 2.6           | 0.1
	ember-data/version                                | 161.00 B  | 34.11 B    | 1.9           | 0.1

Package: ember-inflector
┌──────────────┬───────────┐
│   (index)    │  Values   │
├──────────────┼───────────┤
│    bytes     │ '6.67 KB' │
│  compressed  │ '1.41 KB' │
│ % Of Library │   '4.0'   │
└──────────────┴───────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	ember-inflector/lib/system/inflector              | 2.96 KB   | 642.88 B   | 44.4          | 1.8
	ember-inflector/lib/system/inflections            | 1.59 KB   | 344.75 B   | 23.8          | 0.9
	ember-inflector/lib/system                        | 471.00 B  | 99.80 B    | 6.9           | 0.3
	ember-inflector/index                             | 379.00 B  | 80.30 B    | 5.6           | 0.2
	ember-inflector/lib/helpers/pluralize             | 369.00 B  | 78.18 B    | 5.4           | 0.2
	ember-inflector/lib/utils/make-helper             | 332.00 B  | 70.34 B    | 4.9           | 0.2
	ember-inflector/lib/system/string                 | 318.00 B  | 67.38 B    | 4.7           | 0.2
	ember-inflector/lib/helpers/singularize           | 296.00 B  | 62.72 B    | 4.3           | 0.2

Package: @ember-data/debug
┌──────────────┬────────────┐
│   (index)    │   Values   │
├──────────────┼────────────┤
│    bytes     │ '2.77 KB'  │
│  compressed  │ '600.29 B' │
│ % Of Library │   '1.6'    │
└──────────────┴────────────┘
	Module                                            | Bytes     | Compressed | % of Package  | % Of Library
	-----------------------------------------------------------------------------------------------------
	@ember-data/debug/index                           | 2.27 KB   | 493.28 B   | 82.2          | 1.4
	@ember-data/debug/setup                           | 505.00 B  | 107.00 B   | 17.8          | 0.3

Modern Builds (No Rollup)

☑️ EmberData has not changed in size

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

Changeset



Full Asset Analysis (Modern)

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


Library: EmberData
┌────────────┬──────────┐
│  (index)   │  Values  │
├────────────┼──────────┤
│   bytes    │ '0.00 B' │
│ compressed │ '1.00 B' │
│  packages  │    0     │
│  modules   │    0     │
└────────────┴──────────┘

@runspired runspired merged commit fe56598 into master Aug 25, 2022
@delete-merged-branch delete-merged-branch bot deleted the runspired/deprecate-proxies branch August 25, 2022 23:30
@runspired runspired added this to the 🔌 Unplug 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 🎯 canary PR is targeting canary (default) 🏷️ deprecation 🌲 Project Trim 🌲 PRs related to https://github.com/emberjs/data/issues/6166 🔌 Project Unplug 🔌
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant