Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance regression of compileJava task after update from 6.4.1 #14877

Open
ve2m opened this issue Oct 15, 2020 · 3 comments
Open

Performance regression of compileJava task after update from 6.4.1 #14877

ve2m opened this issue Oct 15, 2020 · 3 comments

Comments

@ve2m
Copy link

ve2m commented Oct 15, 2020

Execution time of compileJava task is much slower when upgrading from 6.4.1 to newer versions (6.5-6.8) and using hibernate-jpamodelgen annotation processor (~15s vs ~40s for the real project, ~3s vs ~6s for the sample project linked below).

Steps to Reproduce

  1. git clone https://github.com/ve2m/gradle-performace-regression-demo.git
  2. Run this 3-5 times, compileJava takes ~3s for me.
    ./gradlew wrapper --gradle-version=6.4.1 && ./gradlew clean compileJava --info
  3. Run this 3-5 times, compileJava takes ~6s.
    ./gradlew wrapper --gradle-version=6.7 && ./gradlew clean compileJava --info
  4. Run this 3-5 times (hibernate-jpamodelgen is disabled), compileJava takes ~3s.
    ./gradlew wrapper --gradle-version=6.7 && ./gradlew clean compileJava --info -PnoJpamodelgen

Your Environment

Version jpamodelgen compileJava time Build scan
6.4.1 ✔️ 3.4s https://scans.gradle.com/s/tgkltp7k3whie
6.4.1 2.8s https://scans.gradle.com/s/4r7g5iyf6zewi
6.7 ✔️ 6.4s https://scans.gradle.com/s/64wif322ghbq4
6.7 2.8s https://scans.gradle.com/s/ngll5ewtz4kuk
@MaciejDobrowolski
Copy link

MaciejDobrowolski commented Mar 3, 2021

hint, possibly: if the build is run with javac parameters: -XprintProcessorInfo -XprintRounds we can see significant delays between the annotation processors rounds (like 1 min of doing nothing in the case of my project):

like here, gradle 6.8.3:

[2021-03-03 17:08:41] Round 1:
[2021-03-03 17:08:41] 	input files: {my files}
[2021-03-03 17:08:41] 	annotations: [{spring annotations} {lombok annotations} {javax annotations} {hibernate envers} {and so on}]
[2021-03-03 17:08:41] 	last round: false
[2021-03-03 17:08:52] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [{spring annotations}] and returns false.
[2021-03-03 17:08:52] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [{lombok annotations}] and returns true.
[2021-03-03 17:08:53] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [{jpa & query dsl annotations}] and returns false.
[2021-03-03 17:08:59] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [{mapstruct annotations}] and returns false.
[2021-03-03 17:08:59] Processor org.gradle.api.internal.tasks.compile.processing.SupportedOptionsCollectingProcessor matches [{blablabla}] and returns false.
[2021-03-03 17:10:01] Round 2:
[2021-03-03 17:10:01] 	input files: {my generated files}
[2021-03-03 17:10:01] 	annotations: [{...}]
[2021-03-03 17:10:01] 	last round: false
[2021-03-03 17:10:02] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [{spring annotations}] and returns false.
[2021-03-03 17:10:02] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [] and returns true.
[2021-03-03 17:10:02] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [] and returns false.
[2021-03-03 17:10:02] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [] and returns false.
[2021-03-03 17:10:02] Processor org.gradle.api.internal.tasks.compile.processing.SupportedOptionsCollectingProcessor matches [{...}] and returns false.

gradle 6.3:

[2021-03-03 16:56:07] Round 1:
[2021-03-03 16:56:07] 	input files: {my files}
[2021-03-03 16:56:07] 	annotations: [{spring annotations} {lombok annotations} {javax annotations} {hibernate envers} {and so on}]
[2021-03-03 16:56:07] 	last round: false
[2021-03-03 16:56:17] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [{spring annotations}] and returns false.
[2021-03-03 16:56:17] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [{lombok annotations}] and returns true.
[2021-03-03 16:56:18] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [{jpa & query dsl annotations}] and returns false.
[2021-03-03 16:56:25] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [{mapstruct annotations}] and returns false.
[2021-03-03 16:56:25] Processor org.gradle.api.internal.tasks.compile.processing.SupportedOptionsCollectingProcessor matches [{blabla}] and returns false.
[2021-03-03 16:56:26] Round 2:
[2021-03-03 16:56:26] 	input files: {my generated files}
[2021-03-03 16:56:26] 	annotations: [{...}]
[2021-03-03 16:56:26] 	last round: false
[2021-03-03 16:56:27] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [{spring annotations}] and returns false.
[2021-03-03 16:56:27] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [] and returns true.
[2021-03-03 16:56:27] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [] and returns false.
[2021-03-03 16:56:27] Processor org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor matches [] and returns false.
[2021-03-03 16:56:27] Processor org.gradle.api.internal.tasks.compile.processing.SupportedOptionsCollectingProcessor matches [{...}] and returns false.

@jjohannes jjohannes added a:bug and removed @jvm a:regression This used to work labels Mar 22, 2021
@ve2m
Copy link
Author

ve2m commented Mar 29, 2021

The problem is still present on 7.0-rc-1.

@davweb
Copy link

davweb commented Aug 18, 2021

This issue was resolved for me by updating my JDK.

In my case going from OpenJDK 11.0.2 to 11.0.12 brought the compile times back to normal on the later versions of Gradle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants