Skip to content

Commit 8a0b2ad

Browse files
Merge pull request #2954 from dotty-staging/add-bootstraped-bench
Add dotty boostrapped benchmarks
2 parents 4dc27d2 + 81b1603 commit 8a0b2ad

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

bench/src/main/scala/Benchmarks.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ object Bench {
3636
.mode(Mode.AverageTime)
3737
.timeUnit(TimeUnit.MILLISECONDS)
3838
.forks(1)
39-
.warmupIterations(12)
39+
.warmupIterations(30)
4040
.measurementIterations(20)
4141
.build
4242

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ val `dotty-sbt-bridge-bootstrapped` = Build.`dotty-sbt-bridge-bootstrapped`
1414
val `dotty-language-server` = Build.`dotty-language-server`
1515
val sjsSandbox = Build.sjsSandbox
1616
val `dotty-bench` = Build.`dotty-bench`
17+
val `dotty-bench-bootstrapped` = Build.`dotty-bench-bootstrapped`
1718
val `scala-library` = Build.`scala-library`
1819
val `scala-compiler` = Build.`scala-compiler`
1920
val `scala-reflect` = Build.`scala-reflect`

project/Build.scala

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ object Build {
232232
}
233233
)
234234

235+
lazy val commonBenchmarkSettings = Seq(
236+
mainClass in (Jmh, run) := Some("dotty.tools.benchmarks.Bench"), // custom main for jmh:run
237+
javaOptions += "-DBENCH_CLASS_PATH=" + Attributed.data((fullClasspath in Compile).value).mkString("", ":", "")
238+
)
239+
235240
// sbt >= 0.13.12 will automatically rewrite transitive dependencies on
236241
// any version in any organization of scala{-library,-compiler,-reflect,p}
237242
// to have organization `scalaOrganization` and version `scalaVersion`
@@ -822,11 +827,13 @@ object Build {
822827

823828
lazy val `dotty-bench` = project.in(file("bench")).
824829
dependsOn(`dotty-compiler`).
825-
settings(commonNonBootstrappedSettings).
826-
settings(
827-
mainClass in (Jmh, run) := Some("dotty.tools.benchmarks.Bench"), // custom main for jmh:run
828-
javaOptions += "-DBENCH_CLASS_PATH=" + Attributed.data((fullClasspath in Compile).value).mkString("", ":", "")
829-
).
830+
settings(commonNonBootstrappedSettings ++ commonBenchmarkSettings).
831+
enablePlugins(JmhPlugin)
832+
833+
lazy val `dotty-bench-bootstrapped` = project.in(file("bench-bootstrapped")).
834+
dependsOn(`dotty-compiler-bootstrapped`).
835+
settings(commonBootstrappedSettings ++ commonBenchmarkSettings).
836+
settings(unmanagedSourceDirectories in Compile ++= Seq(baseDirectory.value / ".." / "bench" / "src")).
830837
enablePlugins(JmhPlugin)
831838

832839
// Depend on dotty-library so that sbt projects using dotty automatically

0 commit comments

Comments
 (0)