-
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
Lincheck benchmarks #250
base: develop
Are you sure you want to change the base?
Lincheck benchmarks #250
Conversation
...m/test/org/jetbrains/kotlinx/lincheck_test/verifier/linearizability/RendezvousChannelTest.kt
Outdated
Show resolved
Hide resolved
src/jvm/test/org/jetbrains/kotlinx/lincheck_test/representation/ThreadDumpTest.kt
Outdated
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/CTestConfiguration.kt
Outdated
Show resolved
Hide resolved
...jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/running/RendezvousChannelBenchmark.kt
Outdated
Show resolved
Hide resolved
src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/running/LocksBenchmarks.kt
Outdated
Show resolved
Hide resolved
...jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/running/ConcurrentHashMapBenchmark.kt
Outdated
Show resolved
Hide resolved
src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/running/ConcurrentDequeBenchmark.kt
Outdated
Show resolved
Hide resolved
src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/running/BufferedChannelBenchmark.kt
Outdated
Show resolved
Hide resolved
src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/running/LocksBenchmarks.kt
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/strategy/stress/StressStrategy.kt
Outdated
Show resolved
Hide resolved
f6d693d
to
23ea160
Compare
c0e8ce9
to
2b8d4fa
Compare
Hi @ndkoval ! |
d4f3ada
to
926ddb2
Compare
src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/running/ConcurrentDequeBenchmark.kt
Show resolved
Hide resolved
@@ -39,6 +45,51 @@ kotlin { | |||
val test by compilations.getting { | |||
kotlinOptions.jvmTarget = "11" | |||
} | |||
|
|||
val benchmark by compilations.creating { |
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 take a look how it is done in the Kotlin coroutines repo
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.
Could you please point out to some specific part or example of gradle scripts you mean, or describe what is the problem with the current code.
The kotlin coroutines build setup is quite large and complicated, what exactly should I look for?
It looks like they use subprojects approach, and benchmarks, in particular, is one of the subprojects.
Is that what you mean? If yes, what are the benefits of using subprojects for benchmarks compared to having them as another source set?
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.
Making it a subproject makes the build script simpler and modularized, with all the dependencies and hacks necessary for benchmarks being configured for benchmarks only and in a separate file.
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.
Also, it is much shorter 🙃
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 try it.
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 have tried the sub-projects approach and it haven't worked out.
The problem is that if we extract the benchmarks into a separate sub-project, then we have to add a dependency from benchmarks sub-module to a the lincheck itself.
But, because the lincheck itself is not a sub-project, but a top-level project, we cannot do (i.e., adding dependency { implementation(rootProject) }
does not work).
It seems that currently Lincheck project structure does not adhere to the standard recommended project structure, where the top-level build.gradle.kts
simply imports sub-projects and defines common configuration, and individual sub-projects' build.gradle.kts
files define build scripts for sub-components, like lib
, app
, benchmarks
, etc: https://docs.gradle.org/current/userguide/multi_project_builds.html
The kotlinx-coroutines project also follows this convention, and thus we cannot simply re-use it in Lincheck.
It defines a kotlinx-coroutines-core
sub-project with core coroutine library primitives.
The benchmarks
sub-project then
declares a dependency on the core subproject.
And it looks like other kotlin libraries follow the same approach, where the top-level build.gradle.kts
is only an "umbrella" script and everything else is split into sub-projects. Most libraries also define "core" sub-project, which is either named core
or $library-name
:
- https://github.com/Kotlin/kotlinx-atomicfu
- https://github.com/Kotlin/kotlinx-rpc
- https://github.com/Kotlin/kotlinx-io
For us it means that we would have to move the current top-level build.gradle.kts
file into a new "core" sub-project, which we could name either lincheck
, lincheck-core
, or core
.
But this is a major change, which I think we should implement in a separate PR, not as a part of benchmarks PR.
Also this change is likely to produce a lot of merge-conflicts with existing active feature branches, so we should plan it thoughtfully and coordinate with other folks who currently work on various features in Lincheck.
I have very limited knowledge of gradle, so perhaps there is some way to overcome the problems described above. But I do not know how to do without major refactoring of project structure.
src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/AbstractLincheckBenchmark.kt
Show resolved
Hide resolved
src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/AbstractLincheckBenchmark.kt
Outdated
Show resolved
Hide resolved
src/jvm/benchmark/org/jetbrains/kotlinx/lincheck_benchmark/AbstractLincheckBenchmark.kt
Show resolved
Hide resolved
src/jvm/main/org/jetbrains/kotlinx/lincheck/LincheckRunTracker.kt
Outdated
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]>
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]>
* remove unused `chainTrackers` * rename `ChainedRunTracker` into `ChainRunTracker` * improve documentation in `LincheckRunTracker` 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]>
1e66117
to
bf35150
Compare
This PR adds benchmarking infrastructure to the Lincheck. It includes:
LincheckRunTracker
interface.LincheckRunTracker
API.