Skip to content

Commit 09ab311

Browse files
Merge pull request #3101 from dotty-staging/add-cold-bench
Add cold bench config
2 parents d6b7812 + 26fdd7c commit 09ab311

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
find collection-strawman/src/main/ -type f \( -name "*.scala" -or -name "*.java" \) -exec echo "dotty-bench/jmh:run 0 1 10" {} + | sbt

bench/scripts/compiler-cold.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
find compiler/src/ -type f \( -name "*.scala" -or -name "*.java" \) -exec echo "dotty-bench/jmh:run 0 1 10" {} + | sbt

bench/scripts/library-cold.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
find library/src/ -type f \( -name "*.scala" -or -name "*.java" \) -exec echo "dotty-bench/jmh:run 0 1 10" {} + | sbt

bench/src/main/scala/Benchmarks.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ object Bench {
2626

2727
val warmup = if (intArgs.length > 0) intArgs(0).toInt else 30
2828
val iterations = if (intArgs.length > 1) intArgs(1).toInt else 20
29+
val forks = if (intArgs.length > 2) intArgs(2).toInt else 1
2930

3031
val args2 = args1.map { arg =>
3132
if ((arg.endsWith(".scala") || arg.endsWith(".java")) && arg.head != '/') "../" + arg
@@ -39,9 +40,9 @@ object Bench {
3940
.jvmArgsPrepend("-Xbootclasspath/a:" + libs + ":")
4041
.mode(Mode.AverageTime)
4142
.timeUnit(TimeUnit.MILLISECONDS)
42-
.forks(1)
4343
.warmupIterations(warmup)
4444
.measurementIterations(iterations)
45+
.forks(forks)
4546
.build
4647

4748
val runner = new Runner(opts) // full access to all JMH features, you can also provide a custom output Format here

0 commit comments

Comments
 (0)