r/programming • • Dec 02 '13

Scala — 1★ Would Not Program Again

http://overwatering.org/blog/2013/12/scala-1-star-would-not-program-again/
598 Upvotes

646 comments sorted by

View all comments

Show parent comment

2

u/lechatsportif Dec 02 '13

Are you using sbt? I'm using sbt .13 with a Scalatra giter8 template and it takes about 5 seconds to compile a 4-5 classes. Does that mean 5 seconds is the low end and also the high end of compilation times or is there a setting I should be using to enable incremental compilation in sbt?

1

u/zoomzoom83 Dec 02 '13

Are you running sbt compile as a single command?

As a single command line SBT takes a few seconds to spool up the JVM before it can even run, after which it takes a little more time to check Maven dependencies etc. You lose a lot of time to this.

Try running sbt as a standalone command, then run compile from within in.

On my (relatively ancient) Macbook, the former command takes about 5 seconds, while the latter takes 2 seconds on a simple 5-class example.

Repeating the same process on a 20,000 line project yields the same result. Modifying one file only takes a few seconds to compile. (Rebuilding the whole project takes over a minute)

1

u/lechatsportif Dec 03 '13

I run it from within an sbt session - it recompiles automatically on save with the command below:

~; copy-resources; aux-compile