Skip to content

Commit 8ea863b

Browse files
committed
fix benchmarks
The classpath is intended for type checking, not for compiler run-time. Thus, they should be passed as compiler options, not JVM options. It works before because the compiler makes bootstrap classpath available for type checking. However, we can no longer use bootstrap classpath after Java 9 support (#3138).
1 parent 6f55382 commit 8ea863b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bench/src/main/scala/Benchmarks.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ object Bench {
3434
}
3535
storeCompileOptions(args2)
3636

37-
val libs = System.getProperty("BENCH_CLASS_PATH")
38-
3937
val opts = new OptionsBuilder()
4038
.shouldFailOnError(true)
41-
.jvmArgsPrepend(s"-classpath $libs", "-Xms2G", "-Xmx2G")
39+
.jvmArgs("-Xms2G", "-Xmx2G")
4240
.mode(Mode.AverageTime)
4341
.timeUnit(TimeUnit.MILLISECONDS)
4442
.warmupIterations(warmup)
@@ -55,9 +53,13 @@ object Bench {
5553
def removeCompileOptions: Unit = new File(COMPILE_OPTS_FILE).delete()
5654

5755
def storeCompileOptions(args: Array[String]): Unit = {
56+
val libs = System.getProperty("BENCH_CLASS_PATH")
57+
5858
val file = new File(COMPILE_OPTS_FILE)
5959
val bw = new BufferedWriter(new FileWriter(file))
60-
bw.write(args.mkString("\n"))
60+
bw.write(args.mkString("", "\n", "\n"))
61+
bw.write("-classpath\n")
62+
bw.write(libs)
6163
bw.close()
6264
}
6365

0 commit comments

Comments
 (0)