compilation slow?

Compiling a scala module is very slow for me. I write a scala spec and every time I chnage something small and want to run it I have to wait a half a minute or so until the module is compiled. I see a lot of messages about loading scala library files (why aren't they loaded just once?).

Are there any settings I can adjust?

Thank you,


I agree, its quite slow. However I see on the order of 5s to compile a test/spec. Which is why I am tending to write many of my tests using groovy/spock. Its ironic that a dynamic language can load the source, parse, compile, perform AST transformations (via spock), load all the dependent classes, and complete the test execution before scalac can even compile the single file. Hopefully someday soon scalac will be nearly as fast as javac. Even better would be for it to be as fast java compiles on eclipse.


My experience is similar.

For day-to-day work, I do all my compiling and testing via SBT. SBT is much more restrictive in what it compiles and in its interactive mode avoids all the start-up and JIT warm-up costs (after the first couple of compilations).

The only time I build inside IDEA is when I want to use its integrated debugger or profile via YourKit (which I've yet to try with Scala code).

Randall Schulz


Randall, maybe no need to waste time with yourkit just yet:


Yes, I'm aware of that situation, as are the Scala principals.



Note: I'm aware that the Scala compiler itself is slow, but it looks like the Scala plugin also contributes by always reloading classes from the standard library. Does the plugin use fsc?


I've switched to Eclipse and compilation there is very fast. Idea's Scala support is superior to Eclipse in every aspect except compilation, but compilation speed is the killer feature IMHO.



Did you have any success using Scala for source files and Groovy for testing?
When I tried it, Groovy can't access/see the scala classes [thread opened for issue] ...



I had no problems with groovy accessing scala classes. Of course you have to be aware of how scala generates the bytecode for methods and and variables as its quite different from javac and groovyc.


Please sign in to leave a comment.