Skip to content

Commit 718c8d9

Browse files
authored
Merge pull request #69 from retronym/topic/bumpity-bump
Version Bump Party
2 parents eba2866 + e2a6917 commit 718c8d9

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

build.sbt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ name := "compiler-benchmark"
55

66
version := "1.0-SNAPSHOT"
77

8-
def scala211 = "2.11.11"
9-
def dottyLatest = "0.2.0-RC1"
10-
scalaVersion in ThisBuild := scala211
8+
def scala212 = "2.12.6"
9+
def dottyLatest = "0.8.0-RC1"
10+
scalaVersion in ThisBuild := scala212
11+
val JmhConfig = config("jmh")
1112

1213
commands += Command.command("testAll") { s =>
1314
"test:compile" ::
@@ -16,7 +17,7 @@ commands += Command.command("testAll") { s =>
1617
s"++$dottyLatest" ::
1718
"compilation/test" ::
1819
"hot -psource=vector -wi 1 -i 1 -f1" ::
19-
s"++$scala211" ::
20+
s"++$scala212" ::
2021
"micro/jmh:run -w1 -f1" ::
2122
s
2223
}
@@ -57,7 +58,7 @@ lazy val compilation = addJmh(project).settings(
5758
if (isDotty.value) "ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value
5859
else scalaOrganization.value % "scala-compiler" % scalaVersion.value
5960
},
60-
crossScalaVersions := List(scala211, dottyLatest),
61+
crossScalaVersions := List(scala212, dottyLatest),
6162
unmanagedSourceDirectories.in(Compile) +=
6263
sourceDirectory.in(Compile).value / (if (isDotty.value) "dotc" else "scalac"),
6364
mainClass in (Jmh, run) := Some("scala.bench.ScalacBenchmarkRunner"),
@@ -122,19 +123,20 @@ commands += Command.arb(profParser)((s: State, line: String) => {
122123
def command(outDir: File): String = "-prof perfnorm"
123124
}
124125

125-
val profs = List(perfNorm, basic, async, jfr)
126+
val profs = List(jfr, perfNorm, basic, async)
126127
val commands: List[String] = profs.flatMap { (prof: Profiler) =>
127128
val outDir = file(s"target/profile-${prof.name}")
128129
IO.createDirectory(outDir)
129130
List(line + " -jvmArgs -Dsun.reflect.inflationThreshold=0 " + prof.command(outDir) + s" -o ${(outDir / "jmh.log").getAbsolutePath} -rf json -rff ${(outDir / "result.json").getAbsolutePath}", BasicCommandStrings.FailureWall)
130131
}
131-
s.copy(remainingCommands = BasicCommandStrings.ClearOnFailure :: commands ++ s.remainingCommands)
132+
val remainingCommands1 = (BasicCommandStrings.ClearOnFailure :: commands).map(s => Exec(s, None)) ++ s.remainingCommands
133+
s.copy(remainingCommands = remainingCommands1)
132134
})
133135

134136

135137
def addJmh(project: Project): Project = {
136138
// IntelliJ SBT project import doesn't like sbt-jmh's default setup, which results the prod and test
137139
// output paths overlapping. This is because sbt-jmh declares the `jmh` config as extending `test`, but
138140
// configures `classDirectory in Jmh := classDirectory in Compile`.
139-
project.enablePlugins(JmhPlugin).overrideConfigs(config("jmh").extend(Compile))
141+
project.enablePlugins(JmhPlugin).overrideConfigs(JmhConfig.extend(Compile))
140142
}

compilation/src/main/dotc/scala/tools/benchmark/BenchmarkDriver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trait BenchmarkDriver extends BaseBenchmarkDriver {
1313
depsClasspath.mkString(File.pathSeparator))
1414
}
1515
ctx.setSetting(ctx.settings.migration, false)
16-
ctx.setSetting(ctx.settings.d, tempDir.getAbsolutePath)
16+
ctx.setSetting(ctx.settings.outputDir, tempDir.getAbsolutePath)
1717
ctx.setSetting(ctx.settings.language, List("Scala2"))
1818
val compiler = new dotty.tools.dotc.Compiler
1919
val reporter = dotty.tools.dotc.Bench.doCompile(compiler, allArgs)

compilation/src/main/scala/scala/tools/nsc/HotSbtBenchmark.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import java.io._
44
import java.nio.file._
55
import java.util.concurrent.TimeUnit
66

7-
import org.openjdk.jmh.annotations.Mode.SampleTime
7+
import org.openjdk.jmh.annotations.Mode
88
import org.openjdk.jmh.annotations._
99

1010
@State(Scope.Benchmark)
11-
@BenchmarkMode(Array(SampleTime))
11+
@BenchmarkMode(Array(org.openjdk.jmh.annotations.Mode.SampleTime))
1212
@OutputTimeUnit(TimeUnit.MILLISECONDS)
1313
@Warmup(iterations = 10, time = 10, timeUnit = TimeUnit.SECONDS)
1414
@Measurement(iterations = 10, time = 10, timeUnit = TimeUnit.SECONDS)

compilation/src/main/scala/scala/tools/nsc/ScalacBenchmark.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ object ScalacBenchmarkStandalone {
111111
}
112112

113113
@State(Scope.Benchmark)
114-
@BenchmarkMode(Array(SingleShotTime))
114+
@BenchmarkMode(Array(org.openjdk.jmh.annotations.Mode.SingleShotTime))
115115
@OutputTimeUnit(TimeUnit.MILLISECONDS)
116116
// TODO -Xbatch reduces fork-to-fork variance, but incurs 5s -> 30s slowdown
117117
@Fork(value = 16, jvmArgs = Array("-XX:CICompilerCount=2", "-Xms2G", "-Xmx2G", "-Xss2M"))
@@ -120,7 +120,7 @@ class ColdScalacBenchmark extends ScalacBenchmark {
120120
def compile(): Unit = compileImpl()
121121
}
122122

123-
@BenchmarkMode(Array(SampleTime))
123+
@BenchmarkMode(Array(org.openjdk.jmh.annotations.Mode.SampleTime))
124124
@OutputTimeUnit(TimeUnit.MILLISECONDS)
125125
@Warmup(iterations = 0)
126126
@Measurement(iterations = 1, time = 30, timeUnit = TimeUnit.SECONDS)
@@ -130,7 +130,7 @@ class WarmScalacBenchmark extends ScalacBenchmark {
130130
def compile(): Unit = compileImpl()
131131
}
132132

133-
@BenchmarkMode(Array(SampleTime))
133+
@BenchmarkMode(Array(org.openjdk.jmh.annotations.Mode.SampleTime))
134134
@OutputTimeUnit(TimeUnit.MILLISECONDS)
135135
@Warmup(iterations = 10, time = 10, timeUnit = TimeUnit.SECONDS)
136136
@Measurement(iterations = 10, time = 10, timeUnit = TimeUnit.SECONDS)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.17
1+
sbt.version=1.1.5

project/plugins.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
logLevel := Level.Warn
33

44
// sbt-jmh plugin - pulls in JMH dependencies too
5-
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.0")
5+
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.4")
66

77
// sbt-dotty plugin - to support `scalaVersion := "0.x"`
8-
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.1.2")
8+
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.2.2")

0 commit comments

Comments
 (0)