You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/separate-source-sets.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ A source set defines the location of your source code, the names of compiled cla
20
20
21
21
## Why Have Separate Source Sets for Benchmarks? <aname="why-have-separate-source-sets-for-benchmarks"></a>
22
22
23
-
Having separate source sets for benchmarks offers several advantages:
23
+
Creating separate source sets for benchmarks is especially beneficial when you are integrating benchmarks into an existing project. Here are several advantages of doing so:
24
24
25
25
1.**Organization**: It helps maintain a clean and organized project structure. Segregating benchmarks from the main code makes it easier to navigate and locate specific code segments.
26
26
@@ -65,7 +65,7 @@ Transform your Kotlin JVM project with separate benchmark source sets by followi
65
65
```groovy
66
66
benchmark {
67
67
targets {
68
-
register("benchmarks")
68
+
register("benchmarks")
69
69
}
70
70
}
71
71
```
@@ -93,7 +93,7 @@ Set up your Kotlin Multiplatform project to accommodate separate benchmark sourc
93
93
```kotlin
94
94
benchmark {
95
95
targets {
96
-
register("jvmBenchmark")
96
+
register("benchmark")
97
97
}
98
98
}
99
99
```
@@ -104,11 +104,12 @@ Set up your Kotlin Multiplatform project to accommodate separate benchmark sourc
104
104
105
105
Here are some common questions about creating separate source sets for benchmarks:
106
106
107
-
**Q: Can I use the same benchmark source set for multiple targets?**
108
-
A: While it's possible, it's generally recommended to have separate source sets for different targets to avoid configuration conflicts and ensure more accurate benchmarks.
107
+
**Q: Is it recommended to reuse the same benchmark source set for benchmarking multiple target platforms in a Kotlin Multiplatform Project?**
108
+
A: It's generally recommended to have separate source sets for different targets to avoid configuration conflicts and ensure more accurate benchmarks. This practice mitigates the risk of configuration conflicts inherent in different platforms that may have unique dependencies and setup requirements.
109
109
110
-
**Q: I'm encountering issues when running benchmarks from the IDE. What should I do?**
111
-
A: Ensure that the `src/benchmark/kotlin` directory is marked as "Sources Root" in your IDE. If you're still experiencing difficulties, refer to the discussions in [issue #112](https://github.com/Kotlin/kotlinx-benchmark/pull/112) for potential solutions.
110
+
Moreover, the performance characteristics can vary significantly across platforms. Having separate source sets for each benchmarking target ensures that your benchmarking process accurately reflects the performance of your code in its specific operational context.
111
+
112
+
For instance, consider a multiplatform project with JVM and JavaScript targets. Rather than using a single shared benchmark source set, you should ideally create two separate benchmark source sets, say `jvmBenchmark` and `jsBenchmark`. By doing so, you are able to customize each benchmark source set according to the peculiarities and performance nuances of its corresponding platform, thereby yielding more accurate and meaningful benchmarking results.
112
113
113
114
**Q: Where can I ask additional questions?**
114
-
A: Feel free to post any questions or issues on the [kotlinx-benchmarkGitHub page](https://github.com/Kotlin/kotlinx-benchmark). The community is always ready to assist you!
115
+
A: We invite you to bring your questions or issues to several platforms. For more immediate interactive feedback, consider joining our [Slack channel](https://kotlinlang.slack.com) where developers and Kotlin enthusiasts discuss a range of topics. For more in-depth, threaded discussions, post your queries on the [GitHub Discussions page](https://github.com/Kotlin/kotlinx-benchmark/discussions) for kotlinx-benchmark. You're also welcome to raise specific issues on the [kotlinx-benchmark GitHub page](https://github.com/Kotlin/kotlinx-benchmark). Each of these platforms is actively monitored, and the community is always prepared to assist you!
0 commit comments