graphql-java: DataFetchingFieldSelectionSet updates in 16.1 can't handle recursive schema properly and causing slowness

Describe the bug We are upgrading our library dependency from 15.0 to 16.1 recently and found that DataFetchingFieldSelectionSet updated at https://github.com/graphql-java/graphql-java/pull/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.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (11 by maintainers)

Most upvoted comments

@aleksandarsusnjar I think it is related. meanwhile I just downgraded to 15.0 so that I can continue to work on the project.