Open axkr opened 3 years ago
Yes, that would be recommendable. But priority is low for me.
A side note: For this kind of software, performance bugs are almost as much a bug as compiler errors. And they are harder to detect and need special testing. My performance tests are typically open end (on factor argument size) and terminated by the developer (me) when he has seen enough. This may take a long time, typically hours, sometimes days. So performance tests are not very well-suited to CI tests, I would say. Unless you convince me otherwise ;-)
Don't know your requirements exactly, but there are tools for these cases.
For example:
Thanks for pointing out. Don't see though how that approach could handle large test runtimes appropriately.
For testing smaller but performance sensitive parts of the code I recommend using the Java Microbenchmarking Harness - JMH:
It is created by the developers of the openJDK them self, so I assume it is very sophisticated and reliable.
It is mainly distributed as Maven project and then quite straight forward to set it up. The following is one guide, but there are plenty others in the internet: https://www.baeldung.com/java-microbenchmark-harness
If you can relay on JMH it could speed up your performance tests significantly. You could even run them in the CI, but then it should be ensured that for each run the same hardware is used to get comparable results.
Please create a Maven github action to automatically test and build a JAR for every commit:
Define Maven
pom.xml
Define Maven folder structure:
/src/main/java
/src/main/ressources
/src/test/java
/src/main/ressources
Move JUnit dependencies to Maven test scope only