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

**URL:** <https://discourse.hibernate.org/t/could-the-hibernate-jpamodelgen-plugin-affect-the-performance-of-gradles-compilejava-task/4728>\
**Category:** Hibernate ORM\
**Created:** [November 4, 2020, 10:27pm UTC](https://discourse.hibernate.org/t/could-the-hibernate-jpamodelgen-plugin-affect-the-performance-of-gradles-compilejava-task/4728 "2020-11-04T22:27:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ve2m](https://avatars.discourse-cdn.com/v4/letter/v/a88e4f/32.png) [@ve2m](https://discourse.hibernate.org/u/ve2m)\
**Post date:** [November 4, 2020, 10:27pm UTC](https://discourse.hibernate.org/t/could-the-hibernate-jpamodelgen-plugin-affect-the-performance-of-gradles-compilejava-task/4728/1 "2020-11-04T22:27:06Z")

</div>

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](https://github.com/gradle/gradle/issues/14877)

Thank you.

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [November 5, 2020, 6:44am UTC](https://discourse.hibernate.org/t/could-the-hibernate-jpamodelgen-plugin-affect-the-performance-of-gradles-compilejava-task/4728/2 "2020-11-05T06:44:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ve2m](https://avatars.discourse-cdn.com/v4/letter/v/a88e4f/32.png) [@ve2m](https://discourse.hibernate.org/u/ve2m)\
**Post date:** [November 5, 2020, 12:34pm UTC](https://discourse.hibernate.org/t/could-the-hibernate-jpamodelgen-plugin-affect-the-performance-of-gradles-compilejava-task/4728/3 "2020-11-05T12:34:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [November 5, 2020, 2:21pm UTC](https://discourse.hibernate.org/t/could-the-hibernate-jpamodelgen-plugin-affect-the-performance-of-gradles-compilejava-task/4728/4 "2020-11-05T14:21:47Z")

</div>

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.
