Skip to content

Commit

Permalink
Add cold bench config
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Sep 11, 2017
1 parent b300826 commit 26fdd7c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bench/scripts/collection-strawman-cold.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
find collection-strawman/src/main/ -type f \( -name "*.scala" -or -name "*.java" \) -exec echo "dotty-bench/jmh:run 0 1 10" {} + | sbt
2 changes: 2 additions & 0 deletions bench/scripts/compiler-cold.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
find compiler/src/ -type f \( -name "*.scala" -or -name "*.java" \) -exec echo "dotty-bench/jmh:run 0 1 10" {} + | sbt
2 changes: 2 additions & 0 deletions bench/scripts/library-cold.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
find library/src/ -type f \( -name "*.scala" -or -name "*.java" \) -exec echo "dotty-bench/jmh:run 0 1 10" {} + | sbt
3 changes: 2 additions & 1 deletion bench/src/main/scala/Benchmarks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ object Bench {

val warmup = if (intArgs.length > 0) intArgs(0).toInt else 30
val iterations = if (intArgs.length > 1) intArgs(1).toInt else 20
val forks = if (intArgs.length > 2) intArgs(2).toInt else 1

val args2 = args1.map { arg =>
if ((arg.endsWith(".scala") || arg.endsWith(".java")) && arg.head != '/') "../" + arg
Expand All @@ -39,9 +40,9 @@ object Bench {
.jvmArgsPrepend("-Xbootclasspath/a:" + libs + ":")
.mode(Mode.AverageTime)
.timeUnit(TimeUnit.MILLISECONDS)
.forks(1)
.warmupIterations(warmup)
.measurementIterations(iterations)
.forks(forks)
.build

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

0 comments on commit 26fdd7c

Please sign in to comment.