-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fix Java 11 performance bug #316
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ndkoval
reviewed
Apr 29, 2024
.../org/jetbrains/kotlinx/lincheck_test/verifier/linearizability/RendezvousChannelCustomTest.kt
Show resolved
Hide resolved
ndkoval
reviewed
Apr 29, 2024
ndkoval
requested changes
Apr 29, 2024
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckJavaAgent.kt
Outdated
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckJavaAgent.kt
Outdated
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckJavaAgent.kt
Show resolved
Hide resolved
Signed-off-by: Evgeniy Moiseenko <[email protected]>
…Stress strategy Signed-off-by: Evgeniy Moiseenko <[email protected]>
…entAllClasses` Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
…ninstall` call Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
ndkoval
requested changes
May 29, 2024
...n/org/jetbrains/kotlinx/lincheck/transformation/transformers/CoroutineSupportTransformers.kt
Outdated
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckJavaAgent.kt
Outdated
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckJavaAgent.kt
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckJavaAgent.kt
Outdated
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckClassVisitor.kt
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckClassVisitor.kt
Show resolved
Hide resolved
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
ndkoval
requested changes
May 30, 2024
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckJavaAgent.kt
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckJavaAgent.kt
Outdated
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckClassVisitor.kt
Show resolved
Hide resolved
Signed-off-by: Evgeniy Moiseenko <[email protected]>
ndkoval
approved these changes
Jun 4, 2024
src/jvm/main/org/jetbrains/kotlinx/lincheck/transformation/LincheckClassVisitor.kt
Show resolved
Hide resolved
@@ -11,15 +11,12 @@ | |||
package org.jetbrains.kotlinx.lincheck.transformation.transformers | |||
|
|||
import org.jetbrains.kotlinx.lincheck.transformation.* | |||
import org.jetbrains.kotlinx.lincheck.transformation.ManagedStrategyMethodVisitor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please always use "*" in imports
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #308
This PR fixes the performance problem accidentally introduced in #296 , that manifested on our Java 11 CI builds.
The root cause of the problem and the solution are described below.
The problem was related to the JVM classes re-transformation, performed by the Java agent.
For model checking instrumentation mode, the class re-transformation was performed lazily on demand.
However, for the stress strategy, all the loaded classes were re-transformed eagerly for each Lincheck test.
During a long JVM run (e.g. in case of our CI builds), a lot of classes can be loaded to the JVM, and for each Lincheck test run, the Lincheck JVM agent in the stress model would try to re-transform them.
However, for the stress strategy we actually only need to intercept the suspension points, that is calls to certain internal coroutine methods. The observation is that most of the loaded classes would not contain these calls, so there is no need to constantly re-transform them.
So the solution, implemented in this PR, is to remember all the loaded classes that actually have coroutine calls inside them, and only re-transform these classes (or newly loaded classes) on subsequent Lincheck agent installations.