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

Add a faster version of the field selection merging validation #458

Conversation

SimonAdameit
Copy link
Contributor

@SimonAdameit SimonAdameit commented Sep 18, 2019

The current OverlappingFieldsCanBeMerged validation has performance problems with a high number of fragments or selection sets. This implements a faster version of OverlappingFieldsCanBeMerged, that can deal with a high number of fragments or selection sets without a blowup in runtime.

It also includes JMH for benchmarks.

Fixes: #296

The algorithm is described in:
https://tech.xing.com/graphql-overlapping-fields-can-be-merged-fast-ea6e92e0a01

Below is an example benchmark graph showing the performance improvement for multiple fragments in the same selection set.
2019-09-16 NoOverlapFrag

Alexis Mas and others added 2 commits November 21, 2018 11:21
Implements a faster version of OverlappingFieldsCanBeMerged,
that can deal with a high number of fragments or selection sets
without a blowup in runtime.

Also includes JMH for benchmarks.

Refs:
https://tech.xing.com/graphql-overlapping-fields-can-be-merged-fast-ea6e92e0a01
travisbrown and others added 7 commits November 6, 2019 14:16
…tch-size

Apply max batch size to relation
Also fixes the compilcation on scala 2.11 as that version did not
support SAM lambdas.
Also initialized buffers for these fields with null to remove allocations,
as many fields will not have child selections or fragment spreads.
@SimonAdameit
Copy link
Contributor Author

Migrated to the new temporary sangria organization: sangria-graphql-org#12

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.

Optimize OverlappingFieldsCanBeMerged
7 participants