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

Optimize normalization #2860

Merged
merged 18 commits into from Jan 12, 2021
Merged

Optimize normalization #2860

merged 18 commits into from Jan 12, 2021

Conversation

martinbonnin
Copy link
Contributor

@martinbonnin martinbonnin commented Jan 11, 2021

Introduce NormalizationIRResponseWriter, a ResponseWriter that writes a "normalization IR" later used to compute Records.

This removes one intermediate Map and tree traversal an makes the apolloParseAndNormalize benchmark from ~30 to ~22 ms.

A nice side effect is that it fixes computing records for Json scalar which didn't work when normalizing models (it works in main when normalizing the network response, see #2859)

* A hierarchy of Json object with their fields attached used for normalization
*/
internal object NormalizationIR {
sealed class Element {
Copy link
Contributor

Choose a reason for hiding this comment

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

up to you, just a thought if Node suit better?

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.

None yet

2 participants