-
Notifications
You must be signed in to change notification settings - Fork 275
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 issue with unit tests #1836
Comments
I can't provide the source code for my first build scan (commercial project, closed source), but
|
There is also a performance drop with the intellij-platform-plugin-template project, after having disabled the Gradle caches (
Tested on Arch Linux. |
For me, 2.2.0/2.2.1 adds ~30 seconds to my Gradle import compared for 2.1.0. |
Gradle Scan results don't give enough insight, so I tried really profiling this. To me it looks like most of the code is spent in lazy evaluation of Its logic seems quite suboptimal. During IDE load, we issue a lot of requests to various resources from the IDE plugin (my current estimation is at least one request for each plugin per user's Gradle module, and maybe one or two more for tests). On each resolve of each teeny-tiny So, on each lookup it loads through the whole product's plugin set, scans each (at least its zip directory), and closes most of them back — until the next opening. We cannot cache the open file systems because of how it is supposed to work: each file system will be closed together with its file. But this looks very suboptimal, perhaps we can introduce an index for this information or something; we don't need to load it again if we know the input IDE didn't change. |
So, I've tried adding a very simple cache: JetBrains/intellij-plugin-verifier#1213 This is very far from being optimal, but already decreases the time for my tests from 2 minutes to 1 minute. The problem is that we still do a lot of IDE resolve during a build of a multi-module plugin: for Todosaurus' commit But that probably means we can make it additionally 7x faster, even after the rudimentary optimization! From 1 minute to about Additional info the logs show that some modules, e.g. Even after my optimization, this probably means the same XML file is read for 5 thousand times during the build. We can make it significantly better. There's a vast area for improvement here. |
|
While I believe the message to be related to the number of times we call the plugin verifier, I am also unsure if it's directly related to the performance issue at hand. Most likely not. IntelliJ has a minor plugin configuration issue of some sort, and the fact that the verifier prints a warning is just another side effect of the fact we call it for so many times during the build and testing. |
What happened?
Unit tests are very slow with plugin 2.2.0:
I enter into the test phase, I see several Layout component
org.jetbrains.plugins.emojipicker' has some nonexistent 'classPath' elements: 'plugins\emojipicker\lib\emojipicker.jar
messages, which takes a lot of time, THEN, my unit tests are executed.I also see this message two times at the configuration stage. I don't know if this is related to the issue.
Build scan: https://scans.gradle.com/s/4qoih2c35ezye
Relevant log output or stack trace
Steps to reproduce
gradlew test
Gradle IntelliJ Plugin version
2.2.0
Gradle version
8.10.2
Operating System
Windows
Link to build, i.e. failing GitHub Action job
No response
The text was updated successfully, but these errors were encountered: