diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 149146f..11b828b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,16 +9,18 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17] + java: [8, 21, 25] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5 with: fetch-depth: 0 - - uses: coursier/cache-action@v6 - - uses: actions/setup-java@v2 + - name: Setup JDK + uses: actions/setup-java@v5 with: distribution: temurin java-version: ${{matrix.java}} + cache: sbt + - uses: sbt/setup-sbt@v1 - name: Test run: sbt testAll diff --git a/build.sbt b/build.sbt index c732a36..71b191d 100644 --- a/build.sbt +++ b/build.sbt @@ -2,19 +2,14 @@ name := "compiler-benchmark" version := "1.0-SNAPSHOT" -def scala212 = "2.12.15" -def dottyLatest = "0.25.0" -ThisBuild / scalaVersion := scala212 +def scala213 = "2.13.16" +ThisBuild / scalaVersion := scala213 val JmhConfig = config("jmh") commands += Command.command("testAll") { s => "Test/compile" :: "compilation/test" :: "hot -psource=scalap -wi 1 -i 1 -f1" :: - s"++$dottyLatest" :: - "compilation/test" :: - "hot -psource=re2s -wi 1 -i 1 -f1" :: - s"++$scala212" :: "micro/Jmh/run -w1 -f1" :: s } @@ -53,15 +48,12 @@ lazy val compilation = addJmh(project).settings( // We should be able to switch this project to a broad range of Scala versions for comparative // benchmarking. As such, this project should only depend on the high level `MainClass` compiler API. description := "Black box benchmark of the compiler", - libraryDependencies += { - if (isDotty.value) "ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value - else scalaOrganization.value % "scala-compiler" % scalaVersion.value - }, - crossScalaVersions := List(scala212, dottyLatest), + libraryDependencies += scalaOrganization.value % "scala-compiler" % scalaVersion.value, + crossScalaVersions := List(scala213), Compile / unmanagedSourceDirectories += - (Compile / sourceDirectory).value / (if (isDotty.value) "dotc" else "scalac"), + (Compile / sourceDirectory).value / "scalac", Jmh / run / mainClass := Some("scala.bench.ScalacBenchmarkRunner"), - libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test, + libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.2" % Test, Test / testOptions += Tests.Argument(TestFrameworks.JUnit), Test / test / fork := true, // jmh scoped tasks run with fork := true. ).settings(addJavaOptions).dependsOn(infrastructure) @@ -70,7 +62,7 @@ lazy val javaCompilation = addJmh(project).settings( description := "Black box benchmark of the java compiler", crossPaths := false, Jmh / run / mainClass := Some("scala.bench.ScalacBenchmarkRunner"), - libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test, + libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.2" % Test, Test / testOptions += Tests.Argument(TestFrameworks.JUnit), Test / test/ fork := true // jmh scoped tasks run with fork := true. ).settings(addJavaOptions).dependsOn(infrastructure) @@ -101,14 +93,14 @@ lazy val addJavaOptions = javaOptions ++= { ) } -addCommandAlias("hot", "compilation/jmh:run HotScalacBenchmark -foe true") +addCommandAlias("hot", "compilation/Jmh/run HotScalacBenchmark -foe true") -addCommandAlias("cold", "compilation/jmh:run ColdScalacBenchmark -foe true") +addCommandAlias("cold", "compilation/Jmh/run ColdScalacBenchmark -foe true") commands ++= build.Profiler.commands // duplicated in project/build.sbt -val jmhV = System.getProperty("jmh.version", "1.31") +val jmhV = System.getProperty("jmh.version", "1.37") def addJmh(project: Project): Project = { // IntelliJ SBT project import doesn't like sbt-jmh's default setup, which results the prod and test diff --git a/compilation/src/main/scala/scala/tools/nsc/ThreadCpuTimeProfiler.java b/compilation/src/main/scala/scala/tools/nsc/ThreadCpuTimeProfiler.java index 9be9c31..58df8c5 100644 --- a/compilation/src/main/scala/scala/tools/nsc/ThreadCpuTimeProfiler.java +++ b/compilation/src/main/scala/scala/tools/nsc/ThreadCpuTimeProfiler.java @@ -89,7 +89,7 @@ static class NormTimeResult extends Result { private final long ops; public NormTimeResult(String prefix, long cycles, long instructions) { - super(ResultRole.SECONDARY, Defaults.PREFIX + prefix, of(Double.NaN), "---", AggregationPolicy.AVG); + super(ResultRole.SECONDARY, prefix, of(Double.NaN), "---", AggregationPolicy.AVG); this.prefix = prefix; this.scalar = cycles; this.ops = instructions; @@ -111,7 +111,7 @@ public NormTimeResult aggregate(Collection results) { @Override protected Aggregator getIterationAggregator() { - NormTimeResultAggregator normTimeResultAggregator = new NormTimeResultAggregator(Defaults.PREFIX + prefix); + NormTimeResultAggregator normTimeResultAggregator = new NormTimeResultAggregator(prefix); return (Aggregator) (Object) normTimeResultAggregator; } diff --git a/corpus/scala/21d12e9/df29ebb b/corpus/scala/21d12e9/df29ebb deleted file mode 120000 index 416f374..0000000 --- a/corpus/scala/21d12e9/df29ebb +++ /dev/null @@ -1 +0,0 @@ -df29ebb \ No newline at end of file diff --git a/project/build.properties b/project/build.properties index 46e43a9..5e6884d 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.8.2 +sbt.version=1.11.6 diff --git a/project/build.sbt b/project/build.sbt index 7293c27..725cc38 100644 --- a/project/build.sbt +++ b/project/build.sbt @@ -1,4 +1,4 @@ -val jmhV = System.getProperty("jmh.version", "1.31") // duplicated in build.sbt +val jmhV = System.getProperty("jmh.version", "1.37") // duplicated in build.sbt libraryDependencies ++= List( "org.openjdk.jmh" % "jmh-core" % jmhV, diff --git a/project/plugins.sbt b/project/plugins.sbt index 4da3ed2..58e72ba 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,7 +2,4 @@ logLevel := Level.Warn // sbt-jmh plugin - pulls in JMH dependencies too -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") - -// sbt-dotty plugin - to support `scalaVersion := "0.x"` -addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.2") +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")