Could the hibernate-jpamodelgen plugin affect the performance of Gradle's compileJava task?

Hello,

I’ve opened an issue on Gradle’s Github, but I think it could be related to the plugin itself. Could you please check if my assumptions are correct?

Link: https://github.com/gradle/gradle/issues/14877

Thank you.

Depending on the project size the effects of the plugin can vary sure. You have to understand that the plugin has to discover your entity classes and generate code these, so yes, there is some overhead involved. The more entity classes you have, the more code needs to be generated, the longer it takes.

Thanks for your answer. I rather have a problem with the fact that it’s much slower when using Gradle 6.5 or a newer version. Do you think it’s possible that there is some problem with hibernate-jpamodelgen and not Gradle itself? As you can see in the linked issue, compileJava task is almost 2 times faster when using Gradle 6.4.1, and removing hibernate-jpamodelgen solves the problem.

Sounds like the new gradle version might do some kind of tracking for generated files by annotation processors. You will have to wait and see what the gradle teams says about this.

1 Like