Skip to content

Various memory optimizations #141

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

Merged
merged 28 commits into from
Dec 23, 2020
Merged

Various memory optimizations #141

merged 28 commits into from
Dec 23, 2020

Conversation

wravery
Copy link
Contributor

@wravery wravery commented Dec 23, 2020

This should fix #138, #140. Overall the parsing speed and memory usage is much improved.

wravery and others added 28 commits December 20, 2020 15:13
The parameters are "upgraded" from SelectionSetParams into
FieldParams, then use the move constructor instead
@wravery wravery merged commit c0cdc00 into microsoft:master Dec 23, 2020
@wravery wravery deleted the field_path branch December 23, 2020 05:59
@barbieri
Copy link
Contributor

Any reason you didn't pick the following commits?

@wravery
Copy link
Contributor Author

wravery commented Dec 23, 2020

Any reason you didn't pick the following commits?

I baked that into ModifiedResult<>::resolve instead. Since FieldResult<> is part of the signature for all of the user code I'd rather keep it simpler and easier to understand and encapsulate the complexity in the internals of GraphQLService.h.

Switching to std::async::deferred is there for the converters when it holds the std::future<> alternative, otherwise it uses the approach you had where it creates an immediately-fulfilled std::promise<> and returns that future. It still uses params.launch when peeling off the list modifiers and when visiting fields in SelectionSetVisitor because those are potentially parallelizable.

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.

improve memory consumption
2 participants