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

Improve perf by cloning only newly added relationship #795

Merged

Conversation

enspandi
Copy link
Contributor

Generally loading a large amount of records (e.g. 5000) with a relationship was very slow. The reason seems to be that with each updateRecord operation, the finally action for the sync-cache-integrity-processor processor took more and more time - in the end up to 3ms per relationship per operation. This is because it was deep cloning the list of inverse relationships each time, which grew with each time.

As discussed with @dgeb , changed to clone only the newly added relationship.

This effectively safes a lot of time when dealing with a large number of operations
Copy link
Member

@dgeb dgeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @enspandi!

@dgeb dgeb merged commit d67763d into orbitjs:master Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants