Skip to content

DataFetchingFieldSelectionSet updates in 16.1 can't handle recursive schema properly and causing slowness #2185

Description

@ntf

Describe the bug
We are upgrading our library dependency from 15.0 to 16.1 recently and found that DataFetchingFieldSelectionSet updated at #2079 has a regression in performance making our HTTP request 10+ times longer.

We use Java Flight Recorder to narrow down the root cause and found that it is because the HashMap.resize() in NormalizedQueryTreeFactory.createNormalizedQueryImpl.

image

Below screenshots show that the normalizedFieldToMergedField has 1.29 M entries and other local variables here also extremely large in size.
image

image

To Reproduce
Please provide a code example or even better a test to reproduce the bug.

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