Skip to content

perf: optimize various teardown hotpaths #9967

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

runspired
Copy link
Contributor

Par2 of #9966 this unrolls some loops and prevents some unnecessary scheduling churn and eliminates an unnecessary 2x growth on the legacy support map

@runspired runspired added 🎯 canary PR is targeting canary (default) 🏷️ perf PRs that improve performance in a notable way ci-perf Activates Performance Checks in CI labels Apr 28, 2025
@github-project-automation github-project-automation bot moved this to needs triage in EmberData Apr 28, 2025
Copy link

github-actions bot commented Apr 28, 2025

Performance Report for 50f5a64

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

☑️ duration
phase no difference [0ms to 22ms]
☑️ Phase [navigationStart] => [start-data-generation]
phase no difference [0ms to 1ms]
☑️ Phase [start-data-generation] => [start-push-payload]
phase no difference [-1ms to 2ms]
⚠️ Phase [start-push-payload] => [start-peek-records]
phase estimated regression +9ms [2ms to 15ms] OR +1.11% [0.22% to 1.87%]
☑️ Phase [start-peek-records] => [start-record-materialization]
phase no difference [0ms to 0ms]
☑️ Phase [start-record-materialization] => [end-record-materialization]
phase no difference [-5ms to 4ms]
☑️ Phase [end-record-materialization] => [Test End]
phase no difference [0ms to 0ms]

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

☑️ duration
phase no difference [-11ms to 10ms]
☑️ Phase [navigationStart] => [start-data-generation]
phase no difference [-1ms to 1ms]
☑️ Phase [start-data-generation] => [start-push-payload]
phase no difference [-1ms to 2ms]
☑️ Phase [start-push-payload] => [start-peek-records]
phase no difference [-9ms to 7ms]
☑️ Phase [start-peek-records] => [start-record-materialization]
phase no difference [0ms to 0ms]
☑️ Phase [start-record-materialization] => [end-record-materialization]
phase no difference [-3ms to 2ms]
☑️ Phase [end-record-materialization] => [Test End]
phase no difference [-1ms to 0ms]

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

☑️ duration
phase no difference [-5ms to 10ms]
☑️ Phase [navigationStart] => [start-data-generation]
phase no difference [-1ms to 0ms]
☑️ Phase [start-data-generation] => [start-push-payload]
phase no difference [-2ms to 1ms]
☑️ Phase [start-push-payload] => [start-peek-records]
phase no difference [-2ms to 9ms]
☑️ Phase [start-peek-records] => [start-record-materialization]
phase no difference [0ms to 0ms]
☑️ Phase [start-record-materialization] => [start-field-access]
phase no difference [-2ms to 3ms]
☑️ Phase [start-field-access] => [start-relationship-access]
phase no difference [-1ms to 0ms]
☑️ Phase [start-relationship-access] => [end-relationship-access]
phase no difference [0ms to 0ms]
☑️ Phase [end-relationship-access] => [Test End]
phase no difference [0ms to 0ms]

Scenario - relationship-materialization-simple: ⚠️ Performance regressed

⚠️ duration
phase estimated regression +17ms [14ms to 21ms] OR +4.09% [3.27% to 4.85%]
☑️ Phase [navigationStart] => [start-find-all]
phase no difference [-1ms to 0ms]
⚠️ Phase [start-find-all] => [start-materialization]
phase estimated regression +2ms [0ms to 4ms] OR +1.23% [0.12% to 2.48%]
✅ Phase [start-materialization] => [end-materialization]
phase estimated improvement -4ms [-6ms to -2ms] OR -2.61% [-3.95% to -1.16%]
⚠️ Phase [end-materialization] => [Test End]
phase estimated regression +20ms [20ms to 21ms] OR +78.25% [76.15% to 80.28%]

Scenario - relationship-materialization-complex: ⚠️ Performance regressed

⚠️ duration
phase estimated regression +25ms [14ms to 36ms] OR +0.94% [0.52% to 1.37%]
☑️ Phase [navigationStart] => [start-data-generation]
phase no difference [0ms to 1ms]
☑️ Phase [start-data-generation] => [start-push-payload]
phase no difference [-1ms to 1ms]
☑️ Phase [start-push-payload] => [start-peek-records]
phase no difference [-3ms to 4ms]
☑️ Phase [start-peek-records] => [start-record-materialization]
phase no difference [0ms to 0ms]
⚠️ Phase [start-record-materialization] => [start-relationship-materialization]
phase estimated regression +5ms [4ms to 7ms] OR +4.18% [2.97% to 5.29%]
⚠️ Phase [start-relationship-materialization] => [start-push-payload2]
phase estimated regression +10ms [3ms to 17ms] OR +0.87% [0.28% to 1.43%]
⚠️ Phase [start-push-payload2] => [start-relationship-materialization2]
phase estimated regression +3ms [0ms to 5ms] OR +1.15% [0.16% to 2.19%]
☑️ Phase [start-relationship-materialization2] => [end-relationship-materialization2]
phase no difference [0ms to 2ms]
⚠️ Phase [end-relationship-materialization2] => [Test End]
phase estimated regression +4ms [3ms to 5ms] OR +2.89% [1.94% to 3.77%]

Scenario - unload: ☑️ Performance is stable

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

Scenario - unload-all: ✅ Performance improved

✅ duration
phase estimated improvement -54ms [-61ms to -47ms] OR -4.6% [-5.22% to -3.95%]
✅ Phase [navigationStart] => [start-push-payload]
phase estimated improvement -2ms [-3ms to 0ms] OR -0.74% [-1.26% to -0.23%]
✅ Phase [start-push-payload] => [start-materialization]
phase estimated improvement -8ms [-12ms to -4ms] OR -1.6% [-2.49% to -0.77%]
✅ Phase [start-materialization] => [start-unload-all]
phase estimated improvement -9ms [-12ms to -6ms] OR -4.15% [-5.72% to -2.89%]
✅ Phase [start-unload-all] => [end-unload-all]
phase estimated improvement -35ms [-38ms to -31ms] OR -15.02% [-16.56% to -13.32%]
☑️ Phase [end-unload-all] => [Test End]
phase no difference [-1ms to 0ms]

Scenario - destroy: ⚠️ Performance regressed

⚠️ duration
phase estimated regression +5ms [1ms to 8ms] OR +1.1% [0.3% to 1.92%]
☑️ Phase [navigationStart] => [start-push-payload]
phase no difference [-1ms to 1ms]
☑️ Phase [start-push-payload] => [start-destroy-records]
phase no difference [0ms to 3ms]
⚠️ Phase [start-destroy-records] => [end-destroy-records]
phase estimated regression +7ms [4ms to 9ms] OR +11.37% [6.48% to 15.56%]
✅ Phase [end-destroy-records] => [Test End]
phase estimated improvement -1ms [-2ms to 0ms] OR -2.92% [-5.93% to -1.03%]

Scenario - add-children: ⚠️ Performance regressed

⚠️ duration
phase estimated regression +5ms [3ms to 6ms] OR +1.3% [0.77% to 1.8%]
☑️ Phase [navigationStart] => [start-push-initial-payload]
phase no difference [-1ms to 1ms]
☑️ Phase [start-push-initial-payload] => [start-push-update-payload]
phase no difference [-1ms to 2ms]
⚠️ Phase [start-push-update-payload] => [end-push-update-payload]
phase estimated regression +3ms [2ms to 5ms] OR +3.6% [2.46% to 4.79%]
⚠️ Phase [end-push-update-payload] => [Test End]
phase estimated regression +1ms [0ms to 1ms] OR +2.25% [0.63% to 3.91%]

Scenario - unused-relationships: ☑️ Performance is stable

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

Scenario - update-with-same-state: ☑️ Performance is stable

☑️ duration
phase no difference [-7ms to 2ms]
☑️ Phase [navigationStart] => [start-data-generation]
phase no difference [0ms to 1ms]
☑️ Phase [start-data-generation] => [start-push-initial-payload]
phase no difference [0ms to 1ms]
⚠️ Phase [start-push-initial-payload] => [start-peek-records]
phase estimated regression +2ms [0ms to 3ms] OR +1.8% [0.22% to 3.36%]
☑️ Phase [start-peek-records] => [start-record-materialization]
phase no difference [0ms to 0ms]
☑️ Phase [start-record-materialization] => [start-relationship-materialization]
phase no difference [-1ms to 1ms]
☑️ Phase [start-relationship-materialization] => [start-local-removal]
phase no difference [-3ms to 1ms]
✅ Phase [start-local-removal] => [start-push-minus-one-payload]
phase estimated improvement -3ms [-4ms to -2ms] OR -1.03% [-1.38% to -0.7%]
☑️ Phase [start-push-minus-one-payload] => [start-local-addition]
phase no difference [0ms to 0ms]
☑️ Phase [start-local-addition] => [start-push-plus-one-payload]
phase no difference [-1ms to 2ms]
✅ Phase [start-push-plus-one-payload] => [end-push-plus-one-payload]
phase estimated improvement -1ms [-2ms to 0ms] OR -2.03% [-3.71% to -0.34%]
☑️ Phase [end-push-plus-one-payload] => [Test End]
phase no difference [0ms to 0ms]

Scenario - update-with-same-state-m2m: ✅ Performance improved

✅ duration
phase estimated improvement -13ms [-18ms to -9ms] OR -1.5% [-2.05% to -1.02%]
☑️ Phase [navigationStart] => [start-data-generation]
phase no difference [0ms to 1ms]
✅ Phase [start-data-generation] => [start-push-initial-payload]
phase estimated improvement -5ms [-6ms to -4ms] OR -2.25% [-2.62% to -1.9%]
☑️ Phase [start-push-initial-payload] => [start-peek-records]
phase no difference [-2ms to 0ms]
☑️ Phase [start-peek-records] => [start-record-materialization]
phase no difference [0ms to 0ms]
☑️ Phase [start-record-materialization] => [start-relationship-materialization]
phase no difference [0ms to 0ms]
☑️ Phase [start-relationship-materialization] => [start-local-removal]
phase no difference [0ms to 0ms]
✅ Phase [start-local-removal] => [start-push-minus-one-payload]
phase estimated improvement -6ms [-7ms to -5ms] OR -4.97% [-5.76% to -3.99%]
☑️ Phase [start-push-minus-one-payload] => [start-local-addition]
phase no difference [-2ms to 0ms]
✅ Phase [start-local-addition] => [start-push-plus-one-payload]
phase estimated improvement -2ms [-3ms to -1ms] OR -1.86% [-2.93% to -0.86%]
☑️ Phase [start-push-plus-one-payload] => [end-push-plus-one-payload]
phase no difference [-1ms to 1ms]
☑️ Phase [end-push-plus-one-payload] => [Test End]
phase no difference [0ms to 0ms]

@runspired runspired marked this pull request as draft May 1, 2025 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-perf Activates Performance Checks in CI 🎯 canary PR is targeting canary (default) 🏷️ perf PRs that improve performance in a notable way
Projects
Status: needs triage
Development

Successfully merging this pull request may close these issues.

1 participant