Skip to content

Avoid allocations when dataloader has no work #132

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

Closed
tonyghita opened this issue Sep 28, 2023 · 0 comments · Fixed by #136
Closed

Avoid allocations when dataloader has no work #132

tonyghita opened this issue Sep 28, 2023 · 0 comments · Fixed by #136

Comments

@tonyghita
Copy link

Our GraphQL server has many dataloaders registered. I noticed that each dataloader is dispatched, and lists are allocated even when the dataloader has no work to do.

https://github.com/graphql-java/java-dataloader/blob/master/src/main/java/org/dataloader/DataLoaderHelper.java#L163-L169

It would be great to avoid allocating these lists when the dataloader doesn't have work to do, especially when GraphQL queries are large (many calls to dispatchAll(), and there are many dataloaders registered that are sparsely used.

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 a pull request may close this issue.

1 participant