Skip to content

Avoid allocations when dataloader has no work #132

Closed
@tonyghita

Description

@tonyghita

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions