objectionary / hone-maven-plugin

Maven plugin that applies a number of optimizations to your Bytecode, using EOLANG and 𝜑-calculus, trying to make it work faster
https://www.objectionary.com/hone-maven-plugin/
MIT License
3 stars 0 forks source link

Unit Testing in `hone-maven-plugin` is Extremely Slow #69

Open volodya-lombrozo opened 2 weeks ago

volodya-lombrozo commented 2 weeks ago

I run one of the unit tests using the following command from CLI:

mvn clean test -Dtest=OptimizeMojoTest#optimizesJnaClasses 

It took me 25 min to build and run the test:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  25:00 min
[INFO] Finished at: 2024-11-01T12:01:02+03:00
[INFO] ------------------------------------------------------------------------

A bit later, I changed this test and run it from IDE. This time it took me 1 hour:


[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:11 h
[INFO] Finished at: 2024-11-01T14:58:32+03:00
[INFO] ------------------------------------------------------------------------

Such a long timing makes any development or bug search almost impossible.

volodya-lombrozo commented 2 weeks ago

@yegor256 Could you take a look, please?

volodya-lombrozo commented 2 weeks ago

Blocks https://github.com/objectionary/hone-maven-plugin/issues/58

yegor256 commented 2 weeks ago

@volodya-lombrozo try again, should be much faster now

volodya-lombrozo commented 2 weeks ago

@yegor256 Try where? Should it work faster in the 58 branch?

volodya-lombrozo commented 2 weeks ago

@yegor256 If so, it is still rather long:

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.eolang.hone.OptimizeMojoTest
SLF4J(W): Class path contains multiple SLF4J providers.
SLF4J(W): Found provider [org.slf4j.reload4j.Reload4jServiceProvider@71809907]
SLF4J(W): Found provider [MavenSlf4j()]
SLF4J(W): See https://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J(I): Actual provider is of type [org.slf4j.reload4j.Reload4jServiceProvider@71809907]
09:36:28 [WARN] org.eolang.hone.MayBeSlow: The test optimizesJnaClasses(Path, String) may take longer than a minute; if you want to see the full output of it, set the logging level to "DEBUG" for the "com.yegor256.farea" logging facility, in the "src/test/resources/log4j.properties" file
09:36:28 [WARN] org.eolang.hone.MktmpResolver: The files generated by the optimizesJnaClasses(Path, String) test are in the target/tmp directory
09:36:33 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (5s), please wait...
09:36:43 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (15s), please wait...
09:36:58 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (30s), please wait...
09:37:18 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (50s), please wait...
09:37:43 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (1min), please wait...
09:38:13 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (2min), please wait...
09:38:48 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (2min), please wait...
09:39:28 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (3min), please wait...
09:40:13 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (4min), please wait...
09:41:03 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (5min), please wait...
09:41:58 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (6min), please wait...
09:42:58 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (7min), please wait...
09:43:58 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (8min), please wait...
09:44:58 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (9min), please wait...
09:45:58 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (10min), please wait...
09:46:58 [WARN] org.eolang.hone.MayBeSlow$1: We're still running the test (11min), please wait...
volodya-lombrozo commented 2 weeks ago

@yegor256 It took 21 min in general:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  21:46 min
[INFO] Finished at: 2024-11-02T09:58:17+03:00
[INFO] ------------------------------------------------------------------------
yegor256 commented 2 weeks ago

@volodya-lombrozo a bit faster than before :) I will add some benchmarking today, we will see more objective numbers

yegor256 commented 2 weeks ago

@volodya-lombrozo this is what we have: https://github.com/objectionary/hone-maven-plugin?tab=readme-ov-file#benchmark The slowest step is the unroll one.

volodya-lombrozo commented 1 week ago

@yegor256 We will try to mitigate this problem here