Skip to content

feat(batching): avoid calculating document ast height in advance (#1800) #1801

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

samuelAndalon
Copy link
Contributor

📝 Description

cherry pick #1800

…ediaGroup#1800)

Batching by LEVEL requires to calculate the height of all graphql
documents in a batch request to be calculated before deciding of a
certain level was dispatched, the reason is because a batch request
could contain multiple and potentially different operations, with
different levels, so, to decide if a level was dispatched, we need to
know which operations in the batch request share the same level.

This PR will remove that logic, which was take it from the graphql-java
[MaxDepthInstrumentation](https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/analysis/MaxQueryDepthInstrumentation.java#L56).

Instead we will calculate the height on runtime, simplifying the
dispatch by level instrumentation and removing some CPU usage by not
doing an AST traversal to calculate height.
@samuelAndalon samuelAndalon merged commit 5341525 into ExpediaGroup:6.x.x Jun 19, 2023
@samuelAndalon samuelAndalon deleted the feat/v6-avoid-height-calculation-dl-instrumentation branch June 19, 2023 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants