Significant performance difference of GraphQL.execute()
between 19 and 21~22 version
#3614
Replies: 13 comments
-
Hello, to nitpick and clarify, graphql-java 21.0 is using Java 11. We're not yet adopting Java 17 as the baseline. Thanks for the data points it's great to see others validating the huge effort that's recently gone into performance. There's even more performance improvements included in v22.0. We don't usually backport performance improvements. We typically backport only bugfixes or security updates, and only for a limited time as per our release policy. https://www.graphql-java.com/blog/release-policy Thanks for asking though and thanks for the data! Hopefully you are able to upgrade to a later version of GraphQL Java |
Beta Was this translation helpful? Give feedback.
-
@dondonz Thanks for your response. Okay, we are putting many efforts to use springboot 3 so that we can use dgs 8.x version. Also, thanks for all the efforts for the community having done to make these huge performance improvements. |
Beta Was this translation helpful? Give feedback.
-
The numbers look too good to be true but benchmarks can be like that. Its all depends on the machine and anything else running on it. I ran them on my laptop and I get
So much better but not in the same order of magnitude you have above So v22 is better but not at the same level you have above I also ran them on different JVM because I did it from source and not from a seperate project. It might be worth create a project that depends on the release version rather than from source
The answer is no in terms of code policy and now in terms of being able to even attempt that. There is no magic one thing that makes a difference. Its a series of fixes and changes that compound over versions. |
Beta Was this translation helpful? Give feedback.
-
@bbakerman Thanks for testing it again. The performance improvement is truly unbelievable.
I also tested 1000 friends case with M2 Macbook Pro 12 core. It shows almost exactly 1/10 of the 10000 case, which seems natural.
I understand this. I just had a little hope about a single significant performance bottleneck point that can be back ported to the previous versions which will benefit a lot of users who are still on Spring 5 (Springboot 2.x) and using DGS framework version 5.x. We are now putting a lot of effort on upgrading our application's Springboot version to 3.2.5. |
Beta Was this translation helpful? Give feedback.
-
So you massively nerd sniped me - I wrote a gradle script that takes the grpahql-java version as env variable and I also ran it on different jvms
Which then runs graphql-java versions on 3 different JVMs. And while the newer graphql-java version is clearly faster, the jvm matters as well for example on the JDK 11 (Amazon Correto) with graphql-java 19.0
versus the same code but on the latest JDK 21 (Amazon Correto) with graphql-java 19.0 (same code different JVMs)
eg a JDK 21 (Amazon Correto) with graphql-java 22.0
eg a The benchmark is an in memory set of data and hence all values are in memory as well. Now the thing is graphql-java v22 did something that suits this benchmark. Its removed the We can see that in the v21 comparison JDK 21 (Amazon Correto) with graphql-java 21.0
a 39.4% decrease in ms/op compared to v22. So I suspect the That said I don't get your numbers of Amazon.com-Inc.-21.0.3-with-graphql-java-v20.0.txt |
Beta Was this translation helpful? Give feedback.
-
Thanks for the update. For your reference, I've recorded video evidence to support my previous statement. Sorry for not digging into what makes the difference. |
Beta Was this translation helpful? Give feedback.
-
ps.... just in case you thought nerd sniping was a bad term |
Beta Was this translation helpful? Give feedback.
-
I think I can see a major difference in the Benchmark across versions The older one has
while the later version of that benchmark (which got renamed at some point) took out the When I ran my numbers above I had |
Beta Was this translation helpful? Give feedback.
-
@bbakerman Wow.. that's the exact reason. Sorry for the confusion. v19.11 The reason why going from But still, the |
Beta Was this translation helpful? Give feedback.
-
@bbakerman @FutureGadget I see also big gains (20% faster) in our services. Especially when a |
Beta Was this translation helpful? Give feedback.
-
Oh yes, I remember removing it last year in order to have less noise in the profiler.
I guess to avoid comparing apples to oranges? |
Beta Was this translation helpful? Give feedback.
-
hi Currently I am using graphql-java versions 22; and my jdk version is 17, I have tried jdk11, but still not working. |
Beta Was this translation helpful? Give feedback.
-
https://mkyong.com/java/list-of-java-class-file-major-version-numbers/ This says the class has version 55.0 (aka JDK 11) and then it says This would be expected - ensure you are running the version you think you are. Also please dont just put a comment on a random issue. Create a discussion item here https://github.com/graphql-java/graphql-java/discussions |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The average time take of
executeQuery()
test shows significant difference between version19.11
and21.0
.https://github.com/graphql-java/graphql-java/blob/v21.0/src/test/java/benchmark/BenchMark.java#L54
https://github.com/graphql-java/graphql-java/blob/v19.11/src/test/java/benchmark/BenchMark.java#L55
I've tested it by changing the
NUMBER_OF_FRIENDS
value to 10000, which is 10 times of the default setting in the benchmark test code.Query used in the benchmark code
Object used in the benchmark code
Result by graphql-java versions
Is it possible to apply the performance improvements that were done in 21.0 version to the 19.11 version?
I think the difference is not from java version (graphql-java 21.0 is using java 17) since the improvement is quite huge.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions