runningcode / gradle-doctor

The right prescription for your Gradle build.
http://runningcode.github.io/gradle-doctor
Apache License 2.0
723 stars 47 forks source link

False positive detection + recommendation for GC with JDK17+ #181

Closed ubiratansoares closed 2 years ago

ubiratansoares commented 2 years ago

With the release of* JDK17, ZGC is considered production-ready.

However, when applying

-XX:+UseZGC

for my JVM args Gradle Doctor complains that I'm not using the recommend Parallel GC.

I have an Android project which is fully ready for JDK17 (using Gradle 7.3 and Kotlin 1.6.0) and I wanted to benchmark some builds with ZGC since it seems to deliver great throughput with shorter GC pauses; in my case I can opt-out from the GC prescription if I want so I can proceed with the benchmarks at all.

However I was wondering if we could improve the actual Gradle Doctor prescription by

This feature request is not critical for the short term since JDK17 just landed. I'd be happy to raise a PR around it. 🙂

runningcode commented 2 years ago

Thanks @ubiratansoares . Are there any benchmarks that show that ZGC is faster than the parallel GC for Gradle builds? If so I'm happy to accept this change.

ubiratansoares commented 2 years ago

The article I've linked shows some GC benchmarks using SPECjbb® 2015, but I'm not sure how realistic such results are in the specific context of Gradle builds.

Are you aware of any existing benchmarks comparing GC impact for G1 and Parallel in Gradle builds? Asking because they could be a good starting point to evaluate ZGC as well :)

runningcode commented 2 years ago

Thanks @ubiratansoares . The results for SPECjbb are not relevant for Android builds. Those results also show that G1 is faster than Parallel for those applications. The opposite, however, is true for Gradle builds especially Android Gradle builds. Google has done several internal benchmarks showing that Parallel GC is faster than G1 which is why they make that recommendation on their website. I have also done a benchmark here to show that it is faster for build performance: https://github.com/uber-common/android-build-eval/pull/3

runningcode commented 2 years ago

This is the only benchmark I've found: https://twitter.com/mreichelt/status/1464010532059586562

ubiratansoares commented 2 years ago

Hey @runningcode, I'll close this one for now; if eventually we have some numbers / benchmarks pointing to a good fit for ZGC in Gradle projects - maybe with some other GC-tuning shenanigans! - I'd be happy to re-open this issue :)

Thanks for the pointers you've shared!

morj commented 2 years ago

@ubiratansoares have you tried -XX:+UseShenandoahGC as well?

ubiratansoares commented 2 years ago

@morj Actually not, have you? 👀