-
Notifications
You must be signed in to change notification settings - Fork 31
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
Lincheck benchmarks #250
base: develop
Are you sure you want to change the base?
Lincheck benchmarks #250
Conversation
class SequentialRendezvousIntChannelSpecification : SequentialIntChannelSpecification(capacity = 0) |
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.
Why do you need to rename it? It causes a lot of unrelated changes.
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.
I can revert this.
@@ -25,8 +25,8 @@ class ThreadDumpTest { | |||
repeat(iterations) { | |||
val options = StressOptions() | |||
.minimizeFailedScenario(false) | |||
.iterations(100_000) | |||
.invocationsPerIteration(1) | |||
.iterations(10) |
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.
Why do you need this change?
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.
For some reason, without this the CI do not pass, but fails with OOM.
With this change, the memory usage (according to TC) is roughly the same as on develop branch.
@@ -38,8 +38,10 @@ abstract class CTestConfiguration( | |||
val customScenarios: List<ExecutionScenario> | |||
) { | |||
abstract fun createStrategy( | |||
testClass: Class<*>, scenario: ExecutionScenario, validationFunction: Actor?, | |||
stateRepresentationMethod: Method?, verifier: Verifier |
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.
What is the purpose of not passing a verifier instance in the constructor?
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.
The code for checking invocation result was duplicated in stress and managed strategies.
Once I refactored to be the extension function of Strategy
class, there is no longer a need to pass the verifier in the constructor, since it effectively becomes unused by the concrete Strategy
implementers.
|
||
@ExperimentalCoroutinesApi | ||
@InternalCoroutinesApi | ||
@Param(name = "value", gen = IntGen::class, conf = "1:5") |
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.
Do you need this?
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.
What line exactly do you mean?
The @Param
annotation?
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.
I think @Param
could be removed, yes.
fun get(): Int = lock.withLock { counter } | ||
} | ||
|
||
class IntrinsicLockBenchmark : AbstractLincheckBenchmark() { |
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.
SynchronizedBenchmark?
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.
Ok, will rename
import org.jetbrains.kotlinx.lincheck_benchmark.AbstractLincheckBenchmark | ||
import java.util.concurrent.ConcurrentHashMap | ||
|
||
@Param(name = "key", gen = IntGen::class, conf = "1:5") |
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.
Do you need it?
import org.jetbrains.kotlinx.lincheck_benchmark.AbstractLincheckBenchmark | ||
import java.util.concurrent.* | ||
|
||
@Param(name = "value", gen = IntGen::class, conf = "1:5") |
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.
Do you need it?
import org.jetbrains.kotlinx.lincheck_benchmark.AbstractLincheckBenchmark | ||
|
||
@InternalCoroutinesApi | ||
@Param(name = "value", gen = IntGen::class, conf = "1:5") |
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.
Do you need it?
} | ||
} | ||
|
||
class ReentrantLockBenchmark : AbstractLincheckBenchmark() { |
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.
Do we need this benchmark? It does not look realistic.
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.
I took it from lincheck tests.
There were tests for several kinds of locks: spin locks, intrinsic locks (synchronized), and re-entrant lock objects.
I just changed the lock-protected data structure from set to counter. Because I think the exact data structure used under lock is not relevant for these benchmarks, so I picked the simplest one possible. If you have arguments why we should use sets as an underlying data structure, I will be ready to revert it to sets.
@@ -44,19 +42,11 @@ class StressStrategy( | |||
} | |||
} | |||
|
|||
override fun run(): LincheckFailure? { |
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 make this refactoring (and the one in ManagedStrategy) in a separate PR
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.
Ok.
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.
Done: #262
Signed-off-by: Evgeniy Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgeniy Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgeniy Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
…shboards Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
* rewrite .txt report file on each run * compute average invocation time in case of per-iteration granularity * do not draw error-bars if standard-error is not computed Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
- do not reuse verifier for minimization Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
…r tests Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgenii Moiseenko <evg.moiseenko94@gmail.com>
f6d693d
to
23ea160
Compare
Signed-off-by: Evgeniy Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgeniy Moiseenko <evg.moiseenko94@gmail.com>
Signed-off-by: Evgeniy Moiseenko <evg.moiseenko94@gmail.com>
This PR adds benchmarking infrastructure to the Lincheck. It includes:
LincheckRunTracker
interface.LincheckRunTracker
API.