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

idea: faster store teardown #8074

Closed
runspired opened this issue Jul 25, 2022 · 3 comments
Closed

idea: faster store teardown #8074

runspired opened this issue Jul 25, 2022 · 3 comments
Labels
feature-suggestion 🏷️ perf PRs that improve performance in a notable way

Comments

@runspired
Copy link
Contributor

Currently, when the store is destroyed we iterate and unload all records. This takes a surprisingly large amount of time. In many of ember-data's tests ~20-30% of time spent is spent in our store's destroy lifecycle during teardown.

Unfortunately, we can't simply "not tear things down", because stores are also destroyed for fastboot app instances and cleanup is important for ensuring memory leaks don't happen.

We should re-examine what we actually do/do-not need to cleanup for fastboot/tests and figure out if there isn't a way to do less work.

For ember-data, this could improve our test-suite performance from ~35s to ~25s per test run. While this might not seem like much, we run our tests ~30x/commit to cover all the various scenarios (~3.5min saved). And ember-data only has ~1700 tests. Applications with far larger test suites could significantly benefit from faster teardown, especially those based on libraries like miragejs which encourage over-mocking or which require setting up large amounts of data for even basic acceptance and integration tests.

@runspired
Copy link
Contributor Author

#8084 significantly improved the teardown case. Likely still more wins out there. Differentiating between "store is tearing down" and "unloadAll was called" would be the key.

@runspired
Copy link
Contributor Author

a big boost was found in #8122 but there's probably still a few more big leaps out there.

@runspired
Copy link
Contributor Author

going to close for now as I think current gains have eliminated lowest hanging fruit. Once we no longer extend anything from EmberObject we should revisit.

@runspired runspired added performance feature-suggestion 🏷️ perf PRs that improve performance in a notable way and removed perf labels Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-suggestion 🏷️ perf PRs that improve performance in a notable way
Projects
None yet
Development

No branches or pull requests

1 participant