-
-
Notifications
You must be signed in to change notification settings - Fork 710
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
Slow compile time (probably related to JDK-8152289) #2385
Comments
Thanks for the kind words :) Unfortunately that's not something we can really do something about as we need to use generics and and indeed |
@joel-costigliola We are also facing serious issues with build time duration, as in one project we have ~5 000 unit tests that are heavily using assertJ assertions - as we really like the fluent API and clear messages. After we migrated from jdk8 to jdk11 the build time has increased significantly, so as a potential solution for that we are considering to move from AssertJ to Hamcrest - as by simply doing a search and replace to reduce the number of AssertJ assertions we were able to reduce the build time for the whole project from 6 minutes to 3 minutes (!). But we are treating this as a sort of a last resort measure - as like I mentioned us like AssertJ and we would like to keep it, but without sacrificing build times too much. Do you think that there is anything that we can do which would allow us to keep AssertJ and at the same time reduce the build times? |
I wish there is something we can do but I'm not sure we can on AssertJ codebase. |
It does not seem easy to vote or comment on the JDK issue, I have contacted them to see how to be able to. @patrox have you tried other JDK > 8 to see if the performance is better? |
I know this JDK issue which you are referencing, but in our case, the performance degradation was observed after moving from jdk8 to jdk11, while the mentioned issue describes a performance degradation which was observed in jdk8 already - so IMO this is not related as we didn't notice any performance issues in jdk8. FYI, I played with the mentioned example from this bug report and one of ugly hacks to speed it up was to add some type information, so we don't need to rely on JDK: Before (~50 seconds for the compilation phase):
After (0.5 seconds for the compilation phase):
|
Yes, I tried with JDK 17 and it was comparable to JDK 11. |
@patrox you do what you have to do, no hard feelings from the AssertJ team, I wish I had a better answer to this issue but I don't. |
@patrox my last idea: did you try other JDK like amazon coretto, maybe they have better generics compile support ... |
In general it is always a great idea to use Amazon Corretto :) However in this specific situation I'm afraid it won't help, because Amazon Corretto doesn't have any specific changes or improvements compared to the upstream OpenJDK version of the java compiler. |
Hi, We have use assertj to a project and the maven project has slow testCompile time now. I see this article about slow compile time for overload and generic in JDKs after 8. And the JDK issues was not fixed.
https://softeng.oicr.on.ca/dusan_andric/2019/08/19/assertJ/
It is true?
I think this problem is not about this library. But I think we can make a best pratices to use to avoid this problem.
Is there anything about this?
Assertj is a greatful assert framework. Thanks for build it :)
Reference: JDK-8152289
The text was updated successfully, but these errors were encountered: