Skip to content

Commit 7ac14af

Browse files
author
Abduqodiri Qurbonzoda
committed
Use "source set" consistently in the guide
1 parent 865062c commit 7ac14af

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ kotlinx-benchmark is a toolkit for running benchmarks for multiplatform code wri
3030
- [Writing Benchmarks](#writing-benchmarks)
3131
- [Running Benchmarks](#running-benchmarks)
3232
- [Benchmark Configuration Profiles](#benchmark-configuration-profiles)
33-
- [Separate module for benchmarks](#separate-module-for-benchmarks)
33+
- [Separate source set for benchmarks](#separate-source-set-for-benchmarks)
3434
- [Examples](#examples)
3535
- [Contributing](#contributing)
3636

@@ -41,7 +41,7 @@ kotlinx-benchmark is a toolkit for running benchmarks for multiplatform code wri
4141
- [Understanding Benchmark Runtime](docs/benchmark-runtime.md)
4242
- [Configuring kotlinx-benchmark](docs/configuration-options.md)
4343
- [Interpreting and Analyzing Results](docs/interpreting-results.md)
44-
- [Creating a Separate Benchmark Module](docs/separate-benchmark-module.md)
44+
- [Setting Up a Separate Source Set for Benchmarks](docs/separate-benchmark-module.md)
4545
- [Tasks Overview](docs/tasks-overview.md)
4646
- [Compatibility Guide](docs/compatibility.md)
4747
- [Submitting issues and PRs](CONTRIBUTING.md)
@@ -425,10 +425,10 @@ benchmark {
425425

426426
Refer to our [comprehensive guide](docs/configuration-options.md) to learn about configuration options and how they affect benchmark execution.
427427

428-
### Separate module for benchmarks
428+
### Separate source set for benchmarks
429429

430430
Often you want to have benchmarks in the same project, but separated from main code, much like tests.
431-
Refer to our [detailed documentation](docs/separate-benchmark-module.md) on configuring your project to add a separate module for benchmarks.
431+
Refer to our [detailed documentation](docs/separate-benchmark-module.md) on configuring your project to set up a separate source for benchmarks.
432432

433433
## Examples
434434

docs/separate-benchmark-module.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# Creating Separate Module for Benchmarks
1+
# Setting Up a Separate Source Set for Benchmarks
22

3-
This guide will walk you through the process of creating a separate module for benchmarks in your Kotlin project.
4-
Creating a separate module for benchmarks is especially beneficial when you are integrating benchmarks into an existing project.
3+
This guide will walk you through the process of establishing a dedicated source set for benchmarks within your Kotlin project.
4+
This approach is especially beneficial when you are integrating benchmarks into an existing project.
55
Here are a couple of advantages of doing so:
66

7-
1. **Flexibility**: Creating a separate module allows you to manage your benchmarking code independently. You can compile, test, and run benchmarks without impacting your main source code.
7+
1. **Flexibility**: Setting up a separate source set allows you to manage your benchmarking code independently. You can compile, test, and run benchmarks without impacting your main source code.
88

99
2. **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.
1010

1111
## Step-by-step Setup Guide
1212

13-
Below are the step-by-step instructions to set up a separate module for benchmarks in both Kotlin Multiplatform and Kotlin/JVM projects:
13+
Below are the step-by-step instructions to set up a separate source set for benchmarks in both Kotlin Multiplatform and Kotlin/JVM projects:
1414

1515
### Kotlin Multiplatform Project
1616

17-
Follow these steps to set up a separate compilation for benchmarks:
17+
Follow these steps to set up a separate source set for benchmarks:
1818

1919
1. **Define New Compilation**
2020

@@ -37,7 +37,7 @@ Follow these steps to set up a separate compilation for benchmarks:
3737

3838
2. **Register Benchmark Compilation**
3939

40-
Conclude by registering your new benchmark compilation using its default source set name.
40+
Register your new benchmark compilation using its default source set name.
4141
In this instance, `jvmBenchmark` is the name of the default source set of the `benchmark` compilation.
4242

4343
```kotlin
@@ -49,6 +49,13 @@ Follow these steps to set up a separate compilation for benchmarks:
4949
}
5050
```
5151

52+
3. **Add Benchmarks**
53+
54+
Place your benchmark code into the default source set of the benchmark compilation.
55+
The default source set can also depend on other source sets with benchmarks.
56+
This way you can share benchmarks between multiple benchmark compilations.
57+
Refer to our [writing benchmarks guide](docs/writing-benchmarks.md) for a comprehensive guide on writing benchmarks.
58+
5259
For additional information, refer to the [Kotlin documentation on creating a custom compilation](https://kotlinlang.org/docs/multiplatform-configure-compilations.html#create-a-custom-compilation).
5360
and the [documentation on associating compiler tasks](https://kotlinlang.org/docs/gradle-configure-project.html#associate-compiler-tasks).
5461
[Here is a sample Kotlin Multiplatform project](/examples/kotlin-multiplatform) with a separate compilation for benchmarks.
@@ -85,7 +92,7 @@ Set up a separate benchmark source set by following these simple steps:
8592
8693
3. **Register Benchmark Source Set**
8794
88-
Finally, register your benchmark source set. This informs the kotlinx-benchmark tool
95+
Register your benchmark source set. This informs the kotlinx-benchmark tool
8996
that benchmarks reside within this source set and need to be executed accordingly.
9097
9198
```kotlin
@@ -97,4 +104,9 @@ Set up a separate benchmark source set by following these simple steps:
97104
}
98105
```
99106
107+
4. **Add Benchmarks**
108+
109+
Place your benchmark code into the benchmark source set.
110+
Refer to our [writing benchmarks guide](docs/writing-benchmarks.md) for a comprehensive guide on writing benchmarks.
111+
100112
[Here is a sample Kotlin/JVM project](/examples/kotlin) with custom source set for benchmarks.

0 commit comments

Comments
 (0)