Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ out/
build/
!out/.keep
testlogs/
bench/result.csv

# Ignore build-file
.packages
Expand Down
22 changes: 15 additions & 7 deletions bench/src/main/scala/Benchmarks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,25 @@ object Bench {
val COMPILE_OPTS_FILE = "compile.txt"

def main(args: Array[String]): Unit = {
storeCompileOptions(args)
if (args.isEmpty) {
println("Missing <args>")
return
}

val libs = System.getenv("BOOTSTRAP_APPEND")
val args2 = args.map { arg =>
if (arg.endsWith(".scala")) "../" + arg else arg
}
storeCompileOptions(args2)

val libs = System.getProperty("BENCH_CLASS_PATH")

val opts = new OptionsBuilder()
.jvmArgsPrepend(s"-Xbootclasspath/a:$libs")
.jvmArgsPrepend("-Xbootclasspath/a:" + libs + ":")
.mode(Mode.AverageTime)
.timeUnit(TimeUnit.MICROSECONDS)
.forks(5)
.warmupIterations(5)
.measurementIterations(10)
.timeUnit(TimeUnit.MILLISECONDS)
.forks(1)
.warmupIterations(12)
.measurementIterations(20)
.resultFormat(ResultFormatType.CSV)
.result("result.csv")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this file, and there'll be no result.csv, which is useless.

.build
Expand Down
147 changes: 0 additions & 147 deletions bench/templates/launch.mustache

This file was deleted.

3 changes: 2 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,8 @@ object Build {
dependsOn(`dotty-compiler`).
settings(commonNonBootstrappedSettings).
settings(
mainClass in (Jmh, run) := Some("dotty.tools.benchmarks.Bench") // custom main for jmh:run
mainClass in (Jmh, run) := Some("dotty.tools.benchmarks.Bench"), // custom main for jmh:run
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please print the entire command line that was used to launch the behcnmark vm?

Copy link
Contributor Author

@nicolasstucki nicolasstucki Jul 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liufengyun do you know if that is possible without the jmh plugin?

Copy link
Contributor

@liufengyun liufengyun Jul 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the command runs, we'll have the output in the console, which shows the VM options:

# JMH 1.18 (released 134 days ago)
# VM version: JDK 1.8.0_131, VM 25.131-b11
# VM invoker: /usr/lib/jvm/java-8-oracle/jre/bin/java
# VM options: -Xbootclasspath/a:some/jars
# Warmup: 10 iterations, 1 s each
# Measurement: 20 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: dotty.tools.benchmarks.Worker.compile

javaOptions += "-DBENCH_CLASS_PATH=" + Attributed.data((fullClasspath in Compile).value).mkString("", ":", "")
).
enablePlugins(JmhPlugin).
settings(packSettings).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we don't use sbt-pack, it's fine to just remove the settings.

Expand Down