From 81b1603063425e3fe8cd44e99f1d64693411ec3c Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 3 Aug 2017 15:12:33 +0200 Subject: [PATCH] Add dotty boostrapped benchmarks --- bench/src/main/scala/Benchmarks.scala | 2 +- build.sbt | 1 + project/Build.scala | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/bench/src/main/scala/Benchmarks.scala b/bench/src/main/scala/Benchmarks.scala index dd5cfe4df6ae..03e0c2302479 100644 --- a/bench/src/main/scala/Benchmarks.scala +++ b/bench/src/main/scala/Benchmarks.scala @@ -36,7 +36,7 @@ object Bench { .mode(Mode.AverageTime) .timeUnit(TimeUnit.MILLISECONDS) .forks(1) - .warmupIterations(12) + .warmupIterations(30) .measurementIterations(20) .build diff --git a/build.sbt b/build.sbt index 0bf05799451c..a27722235ee1 100644 --- a/build.sbt +++ b/build.sbt @@ -14,6 +14,7 @@ val `dotty-sbt-bridge-bootstrapped` = Build.`dotty-sbt-bridge-bootstrapped` val `dotty-language-server` = Build.`dotty-language-server` val sjsSandbox = Build.sjsSandbox val `dotty-bench` = Build.`dotty-bench` +val `dotty-bench-bootstrapped` = Build.`dotty-bench-bootstrapped` val `scala-library` = Build.`scala-library` val `scala-compiler` = Build.`scala-compiler` val `scala-reflect` = Build.`scala-reflect` diff --git a/project/Build.scala b/project/Build.scala index 13919fddacc0..ed67c63ef7e1 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -232,6 +232,11 @@ object Build { } ) + lazy val commonBenchmarkSettings = Seq( + mainClass in (Jmh, run) := Some("dotty.tools.benchmarks.Bench"), // custom main for jmh:run + javaOptions += "-DBENCH_CLASS_PATH=" + Attributed.data((fullClasspath in Compile).value).mkString("", ":", "") + ) + // sbt >= 0.13.12 will automatically rewrite transitive dependencies on // any version in any organization of scala{-library,-compiler,-reflect,p} // to have organization `scalaOrganization` and version `scalaVersion` @@ -822,11 +827,13 @@ object Build { lazy val `dotty-bench` = project.in(file("bench")). dependsOn(`dotty-compiler`). - settings(commonNonBootstrappedSettings). - settings( - mainClass in (Jmh, run) := Some("dotty.tools.benchmarks.Bench"), // custom main for jmh:run - javaOptions += "-DBENCH_CLASS_PATH=" + Attributed.data((fullClasspath in Compile).value).mkString("", ":", "") - ). + settings(commonNonBootstrappedSettings ++ commonBenchmarkSettings). + enablePlugins(JmhPlugin) + + lazy val `dotty-bench-bootstrapped` = project.in(file("bench-bootstrapped")). + dependsOn(`dotty-compiler-bootstrapped`). + settings(commonBootstrappedSettings ++ commonBenchmarkSettings). + settings(unmanagedSourceDirectories in Compile ++= Seq(baseDirectory.value / ".." / "bench" / "src")). enablePlugins(JmhPlugin) // Depend on dotty-library so that sbt projects using dotty automatically