Skip to content

Conversation

@bbakerman
Copy link
Member

Baseline : 
NQBenchmark.benchMarkThroughput  thrpt    9  58179.108 ± 3248.527  ops/s
NQBenchmark.benchMarkAvgTime      avgt    9      0.022 ±    0.011  ms/op

Progress:
NQBenchmark1.benchMarkThroughput  thrpt    9  60097.926 ± 2723.146  ops/s
NQBenchmark1.benchMarkAvgTime      avgt    9      0.016 ±    0.001  ms/op

Final : 
NQBenchmark1.benchMarkThroughput  thrpt    9  61725.227 ± 2766.171  ops/s
NQBenchmark1.benchMarkAvgTime      avgt    9      0.016 ±    0.001  ms/op

GraphQLCodeRegistry codeRegistry = GraphQLCodeRegistry.newCodeRegistry().fieldVisibility(DEFAULT_FIELD_VISIBILITY).build();
return getArgumentValuesImpl(codeRegistry, argumentTypes, arguments, coercedVariables);
return getArgumentValuesImpl(DEFAULT_FIELD_VISIBILITY, argumentTypes, arguments, coercedVariables);
}
Copy link
Member Author

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;
Copy link
Member Author

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;
Copy link
Member Author

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();
}
Copy link
Member Author

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);
}
Copy link
Member Author

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));
Copy link
Member Author

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
@bbakerman bbakerman added this to the 18.0 milestone Feb 28, 2022
@bbakerman bbakerman merged commit 0b887a9 into master Feb 28, 2022
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.

2 participants