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

perf(core): Improved performance of validateVariantOptionIds #337

Merged
merged 1 commit into from
May 11, 2020
Merged

Conversation

Tyratox
Copy link
Contributor

@Tyratox Tyratox commented May 10, 2020

This pull request tries to implement the idea mentioned in #328 (comment).

Step one and two are done at the same time as before as one is required to do the join anyway.
I wasn't able to think of a case where performing the two steps separately would require less memory but I might be missing something.

In addition to the ideas mention I added the eager option to getEntityOrThrow to further decrease the memory required. Is this okay or should this parameter be implemented differently / i.e. a separate function be added with this functionality?

These changes reduce the amount of data loaded into memory which hopefully prevents some server crashes. #328.
Also added the eager option for allowing performance gains in certain queries.
@michaelbromley michaelbromley merged commit 7d19b9c into vendure-ecommerce:master May 11, 2020
@michaelbromley
Copy link
Member

Looks good - the eager option is fine for getEntityOrThrow. Might be useful in optimizing other areas of perf in future, since that function is used a lot all over the service layer. Thanks for your time 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants