From 5189977e8c6aaad548866bee0dec451a29d72c69 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 25 Sep 2025 19:49:14 +0200 Subject: [PATCH 1/7] gha --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 From 268928c016356061961754571a1a78baad6d4ef3 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 25 Sep 2025 15:22:39 +0200 Subject: [PATCH 2/7] update sbt to 1.11.6 --- build.sbt | 4 ++-- project/build.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index c732a36..110e222 100644 --- a/build.sbt +++ b/build.sbt @@ -101,9 +101,9 @@ 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 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 From 11e8a05063ec01ae82987ef2b62fdb11ff53a484 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 25 Sep 2025 15:28:42 +0200 Subject: [PATCH 3/7] update sbt-jmh --- build.sbt | 2 +- project/build.sbt | 2 +- project/plugins.sbt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 110e222..d2b89f9 100644 --- a/build.sbt +++ b/build.sbt @@ -108,7 +108,7 @@ 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/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..2a56763 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,7 +2,7 @@ logLevel := Level.Warn // sbt-jmh plugin - pulls in JMH dependencies too -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") // sbt-dotty plugin - to support `scalaVersion := "0.x"` addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.2") From d594c599c65e8f51f95038ea25b2fd37e11fe1f3 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 25 Sep 2025 15:36:48 +0200 Subject: [PATCH 4/7] 2.13 by default, update junit-interface --- build.sbt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index d2b89f9..094afce 100644 --- a/build.sbt +++ b/build.sbt @@ -2,9 +2,9 @@ name := "compiler-benchmark" version := "1.0-SNAPSHOT" -def scala212 = "2.12.15" +def scala213 = "2.13.16" def dottyLatest = "0.25.0" -ThisBuild / scalaVersion := scala212 +ThisBuild / scalaVersion := scala213 val JmhConfig = config("jmh") commands += Command.command("testAll") { s => @@ -14,7 +14,7 @@ commands += Command.command("testAll") { s => s"++$dottyLatest" :: "compilation/test" :: "hot -psource=re2s -wi 1 -i 1 -f1" :: - s"++$scala212" :: + s"++$scala213" :: "micro/Jmh/run -w1 -f1" :: s } @@ -57,11 +57,11 @@ lazy val compilation = addJmh(project).settings( if (isDotty.value) "ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value else scalaOrganization.value % "scala-compiler" % scalaVersion.value }, - crossScalaVersions := List(scala212, dottyLatest), + crossScalaVersions := List(scala213, dottyLatest), Compile / unmanagedSourceDirectories += (Compile / sourceDirectory).value / (if (isDotty.value) "dotc" else "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 +70,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) From 9c5c24e8e5799c49c6acd30d5fc69457d8fa9e60 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 25 Sep 2025 15:59:14 +0200 Subject: [PATCH 5/7] remove dotty support the old sbt-dotty plugin breaks compilation with recent 2.13 --- build.sbt | 14 +++----------- project/plugins.sbt | 3 --- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/build.sbt b/build.sbt index 094afce..71b191d 100644 --- a/build.sbt +++ b/build.sbt @@ -3,7 +3,6 @@ name := "compiler-benchmark" version := "1.0-SNAPSHOT" def scala213 = "2.13.16" -def dottyLatest = "0.25.0" ThisBuild / scalaVersion := scala213 val JmhConfig = config("jmh") @@ -11,10 +10,6 @@ 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"++$scala213" :: "micro/Jmh/run -w1 -f1" :: s } @@ -53,13 +48,10 @@ 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(scala213, 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.github.sbt" % "junit-interface" % "0.13.2" % Test, Test / testOptions += Tests.Argument(TestFrameworks.JUnit), diff --git a/project/plugins.sbt b/project/plugins.sbt index 2a56763..58e72ba 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,6 +3,3 @@ logLevel := Level.Warn // sbt-jmh plugin - pulls in JMH dependencies too addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") - -// sbt-dotty plugin - to support `scalaVersion := "0.x"` -addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.2") From d3089a0367488d5ca7b0e501d825a4d1c2a00dcc Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 25 Sep 2025 16:10:22 +0200 Subject: [PATCH 6/7] adjust to https://github.com/openjdk/jmh/pull/115 --- .../src/main/scala/scala/tools/nsc/ThreadCpuTimeProfiler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } From f1ba8650aa29f7b6b93c628e1fcde282008c31dc Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 25 Sep 2025 19:55:29 +0200 Subject: [PATCH 7/7] remove bad symlikn --- corpus/scala/21d12e9/df29ebb | 1 - 1 file changed, 1 deletion(-) delete mode 120000 corpus/scala/21d12e9/df29ebb 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