Skip to content

Commit

Permalink
Reduce thread-count in benchmarks
Browse files Browse the repository at this point in the history
GitHub's linux runners only have two cores.

Therefore, running 4 threads for the benchmarks doesn't make sense. Could run 2 threads, but then other OS/GC operations can skew benchmark results. Reducing to 1 thread should give the most stable results.
  • Loading branch information
big-andy-coates committed Nov 16, 2023
1 parent 3bcbc3b commit 8e60d89
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ Running the functional tests will create result files in the `docs/_include` dir

Generated files:

| filename | description | use |
|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|
| `functional-summary.json` | JSON document containing a summary of pass/fail rates of required/optional test cases for each implementation, per supported JSON schema version. | Used to build functional tables and charts in [micro-site][micro-site]. |
| `functional-summary.md` | Markdown document containing a summary of pass/fail rates of required/optional test cases for each implementation, per supported JSON schema version. | Appended to the GitHub workflow job |
| `per-draft.md` | Markdown document containing one table for each implementation and supported schema specification combination, showing the number of test cases that pass and fail in each test file. | Appended to the GitHub workflow job |
| filename | description | use |
|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| `functional-summary.json` | JSON document containing a summary of pass/fail rates of required/optional test cases for each implementation, per supported JSON schema version. | Used to build functional tables and charts in [micro-site][micro-site]. |
| `functional-summary.md` | Markdown document containing a summary of pass/fail rates of required/optional test cases for each implementation, per supported JSON schema version. | Appended to the GitHub workflow job |
| `per-draft.md` | Markdown document containing one table for each implementation and supported schema specification combination, showing the number of test cases that pass and fail in each test file. | Used to build functional tables and charts in [micro-site][micro-site], and appended to the GitHub workflow job |

#### Performance comparison

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ publishing {
name.set("${project.group}:${artifactId}")

if (prependRootName) {
description.set("${rootProject.name.capitalize()} ${project.name} library".replace("-", " "))
description.set("${rootProject.name} ${project.name} library".replace("-", " "))
} else {
description.set("${project.name.capitalize()} library".replace("-", " "))
description.set("${project.name} library".replace("-", " "))
}

url.set("https://www.creekservice.org")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ publishing {
name.set("${project.group}:${artifactId}")

if (prependRootName) {
description.set("${rootProject.name.capitalize()} ${project.name} library".replace("-", " "))
description.set("${rootProject.name} ${project.name} library".replace("-", " "))
} else {
description.set("${project.name.capitalize()} library".replace("-", " "))
description.set("${project.name} library".replace("-", " "))
}

url.set("https://www.creekservice.org")
Expand Down
3 changes: 2 additions & 1 deletion docs/_docs/3. performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ real-world example, using a small common subset of functionality, in the context
as a serialization format. Combined, these should give a good comparison of performance.

**Note:**
The benchmarks are run on GitHub's own infrastructure. These may not be dedicated machines, which can influence performance results.
The benchmarks are run on [GitHub's own infrastructure](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners).
These may not be dedicated machines, which can influence performance results.
{: .notice--warning}

### JSON schema test suite benchmark
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
*/
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(MICROSECONDS)
@Threads(4)
@Threads(1) // GitHub linux runners have two cores, so running more threads is pointless.
@Fork(4) // Note: to debug, set fork to 0.
// @Warmup(iterations = 0, time = 10)
// @Measurement(iterations = 1, time = 10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
*/
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(MILLISECONDS)
@Threads(4)
@Threads(1) // GitHub linux runners have two cores, so running more threads is pointless.
@Fork(4) // Note: to debug, set fork to 0.
// @Warmup(iterations = 0, time = 10)
// @Measurement(iterations = 1, time = 10)
Expand Down

0 comments on commit 8e60d89

Please sign in to comment.