This is some performance optimisations for NormalisedOperations#2732
Merged
This is some performance optimisations for NormalisedOperations#2732
Conversation
Member
bbakerman
commented
Feb 22, 2022
bbakerman
commented
Feb 22, 2022
| GraphQLCodeRegistry codeRegistry = GraphQLCodeRegistry.newCodeRegistry().fieldVisibility(DEFAULT_FIELD_VISIBILITY).build(); | ||
| return getArgumentValuesImpl(codeRegistry, argumentTypes, arguments, coercedVariables); | ||
| return getArgumentValuesImpl(DEFAULT_FIELD_VISIBILITY, argumentTypes, arguments, coercedVariables); | ||
| } |
Member
Author
There was a problem hiding this comment.
We only took the GraphQLCodeRegistry so we could get the field visibility
So we collapsed it so we no longer instantiate an object to get to static
bbakerman
commented
Feb 22, 2022
| createNFs(parameters, fieldsByName, resultNFs, normalizedFieldToAstFields, level, executableNormalizedField); | ||
|
|
||
| return new CollectNFResult(resultNFs, normalizedFieldToAstFields.build()); | ||
| return fieldsByName; |
Member
Author
There was a problem hiding this comment.
common code extracted - not performance work per se
bbakerman
commented
Feb 22, 2022
| .parent(parent) | ||
| .build(); | ||
|
|
||
| return executableNormalizedField; |
Member
Author
There was a problem hiding this comment.
inlined the returned field
bbakerman
commented
Feb 22, 2022
| } | ||
| return result; | ||
| return result.build(); | ||
| } |
Member
Author
There was a problem hiding this comment.
This is used in 2 places (overlapping fields code as well) and both work as expected
bbakerman
commented
Feb 22, 2022
| // System.out.println("fields size:" + normalizedQuery.getFieldToNormalizedField().size()); | ||
| return executableNormalizedOperation; | ||
| blackhole.consume(executableNormalizedOperation); | ||
| } |
bbakerman
commented
Feb 22, 2022
| @BenchmarkMode(Mode.Throughput) | ||
| @OutputTimeUnit(TimeUnit.SECONDS) | ||
| public void overlappingFieldValidationThroughput(MyState myState, Blackhole blackhole) { | ||
| blackhole.consume(validateQuery(myState.schema, myState.document)); |
Member
Author
There was a problem hiding this comment.
Added throughput
I tried to find some perf improvements in Overlapping fields code but none to be easily found
…-ops # Conflicts: # src/main/java/graphql/normalized/ExecutableNormalizedOperationFactory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.