-
Notifications
You must be signed in to change notification settings - Fork 1.2k
This is some performance optimisations for NormalisedOperations #2732
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
Conversation
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); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
| createNFs(parameters, fieldsByName, resultNFs, normalizedFieldToAstFields, level, executableNormalizedField); | ||
|
|
||
| return new CollectNFResult(resultNFs, normalizedFieldToAstFields.build()); | ||
| return fieldsByName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
common code extracted - not performance work per se
| .parent(parent) | ||
| .build(); | ||
|
|
||
| return executableNormalizedField; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inlined the returned field
| } | ||
| return result; | ||
| return result.build(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used in 2 places (overlapping fields code as well) and both work as expected
| // System.out.println("fields size:" + normalizedQuery.getFieldToNormalizedField().size()); | ||
| return executableNormalizedOperation; | ||
| blackhole.consume(executableNormalizedOperation); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added throughput
| @BenchmarkMode(Mode.Throughput) | ||
| @OutputTimeUnit(TimeUnit.SECONDS) | ||
| public void overlappingFieldValidationThroughput(MyState myState, Blackhole blackhole) { | ||
| blackhole.consume(validateQuery(myState.schema, myState.document)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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