aboutsummaryrefslogtreecommitdiff
path: root/bin/dotc
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2014-11-13 17:18:53 +0100
committerGuillaume Martres <smarter@ubuntu.com>2014-11-17 18:54:41 +0100
commitb73ea2fde3949bcd1366cc8778c007619b627481 (patch)
tree85a678f53e1a70906e9083f2b3ff6ab986f4ae91 /bin/dotc
parent7978a5f6a1be13ca9c482c3f2e9c2102018cfcf0 (diff)
downloaddotty-b73ea2fde3949bcd1366cc8778c007619b627481.tar.gz
dotty-b73ea2fde3949bcd1366cc8778c007619b627481.tar.bz2
dotty-b73ea2fde3949bcd1366cc8778c007619b627481.zip
Add option to optimize the JVM for short-runnning applications
Ideally, dotc should reuse a resident compiler and we should not fork sbt for every task. Until this happens, this option is useful for development. Fixes #222. Usage: $ sbt -DOshort="" $ ./bin/dotc -Oshort foo.scala
Diffstat (limited to 'bin/dotc')
-rwxr-xr-xbin/dotc3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/dotc b/bin/dotc
index cafd80f03..72ac3141a 100755
--- a/bin/dotc
+++ b/bin/dotc
@@ -185,6 +185,9 @@ case "$1" in
-d|-debug) debug=true && shift ;;
-q|-quiet) quiet=true && shift ;;
+ # Optimize for short-running applications, see https://github.com/lampepfl/dotty/issues/222
+ -Oshort) addJava "-XX:+TieredCompilation -XX:TieredStopAtLevel=1" && shift ;;
+
-repl) main_class=$ReplMain && shift ;;
-compile) main_class=$CompilerMain && shift ;;
-run) main_class=$ReplMain && shift ;;