Skip to content

Commit 2cc2c86

Browse files
committed
Merge pull request #234 from smarter/try/jvm-tuning
Add option to optimize the JVM for short-runnning applications
2 parents a75b21b + b73ea2f commit 2cc2c86

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

bin/dotc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ case "$1" in
185185
-d|-debug) debug=true && shift ;;
186186
-q|-quiet) quiet=true && shift ;;
187187

188+
# Optimize for short-running applications, see https://github.com/lampepfl/dotty/issues/222
189+
-Oshort) addJava "-XX:+TieredCompilation -XX:TieredStopAtLevel=1" && shift ;;
190+
188191
-repl) main_class=$ReplMain && shift ;;
189192
-compile) main_class=$CompilerMain && shift ;;
190193
-run) main_class=$ReplMain && shift ;;

project/Build.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,14 @@ object DottyBuild extends Build {
6868
else
6969
List()
7070

71-
agentOptions ::: travis_build ::: fullpath
71+
val tuning =
72+
if (sys.props.isDefinedAt("Oshort"))
73+
// Optimize for short-running applications, see https://github.com/lampepfl/dotty/issues/222
74+
List("-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1")
75+
else
76+
List()
77+
78+
tuning ::: agentOptions ::: travis_build ::: fullpath
7279
}
7380
)
7481

0 commit comments

Comments
 (0)