Skip to content

Commit c3ded4f

Browse files
author
Antoine Brunner
committed
Shorten benchmark duration
1 parent 11c1d21 commit c3ded4f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bench-run/src/main/scala/Main.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package dotty.tools.benchmarks
22

33
import org.openjdk.jmh.results.RunResult
44
import org.openjdk.jmh.runner.Runner
5-
import org.openjdk.jmh.runner.options.OptionsBuilder
65
import org.openjdk.jmh.annotations._
76
import org.openjdk.jmh.results.format._
7+
import org.openjdk.jmh.runner.options._
88
import java.util.concurrent.TimeUnit
99

1010
import scala.io.Source
@@ -13,7 +13,7 @@ object Bench {
1313
def main(args: Array[String]): Unit = {
1414
val (intArgs, args1) = args.span(x => try { x.toInt; true } catch { case _: Throwable => false } )
1515

16-
val warmup = if (intArgs.length > 0) intArgs(0).toInt else 30
16+
val warmup = if (intArgs.length > 0) intArgs(0).toInt else 20
1717
val iterations = if (intArgs.length > 1) intArgs(1).toInt else 20
1818
val forks = if (intArgs.length > 2) intArgs(2).toInt else 1
1919

@@ -26,7 +26,9 @@ object Bench {
2626
.mode(Mode.AverageTime)
2727
.timeUnit(TimeUnit.NANOSECONDS)
2828
.warmupIterations(warmup)
29+
.warmupTime(TimeValue.milliseconds(750))
2930
.measurementIterations(iterations)
31+
.measurementTime(TimeValue.milliseconds(500))
3032
.forks(forks)
3133
.include(benchmarks)
3234
.resultFormat(ResultFormatType.CSV)

0 commit comments

Comments
 (0)