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

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

Open
volodya-lombrozo opened this issue Nov 1, 2024 · 9 comments
Open

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

volodya-lombrozo opened this issue Nov 1, 2024 · 9 comments

Comments

@volodya-lombrozo
Copy link
Member

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
Copy link
Member Author

@yegor256 Could you take a look, please?

@volodya-lombrozo
Copy link
Member Author

Blocks #58

yegor256 added a commit that referenced this issue Nov 1, 2024
@yegor256
Copy link
Member

yegor256 commented Nov 1, 2024

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

yegor256 added a commit that referenced this issue Nov 2, 2024
@volodya-lombrozo
Copy link
Member Author

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

@volodya-lombrozo
Copy link
Member Author

@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
Copy link
Member Author

@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
Copy link
Member

yegor256 commented Nov 2, 2024

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

yegor256 added a commit that referenced this issue Nov 2, 2024
yegor256 added a commit that referenced this issue Nov 2, 2024
yegor256 added a commit that referenced this issue Nov 2, 2024
yegor256 added a commit that referenced this issue Nov 2, 2024
yegor256 added a commit that referenced this issue Nov 2, 2024
yegor256 added a commit that referenced this issue Nov 2, 2024
yegor256 added a commit that referenced this issue Nov 2, 2024
@yegor256
Copy link
Member

yegor256 commented Nov 2, 2024

@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
Copy link
Member Author

@yegor256 We will try to mitigate this problem here

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

No branches or pull requests

2 participants