Scala make takes 10s even with no changes whilst Activator is sub-second Follow
Hi all,
I am working on a hello-world Scala/Play app in Intellij IDEA 14.1.1
I am running a very simple test - see below.
Running just this test through Intellij takes 10s even without any changes to the file i.e. no recompilation.
When I have Typesafe activator running it runs all 3 tests in 793 ms.
And even when I make a change it compiles in under a second.
The intellij log output is below. The long delay occurs after the second line for 10s.
Any suggestion as to what I should be doing to make this faster?
Settings screenshots are attached. I've tried various combo's but it hasn't made any difference.
Thanks,
Will
2015-04-12 21:42:31,590 [ 683089] INFO - ij.compiler.impl.CompileDriver - COMPILATION STARTED (BUILD PROCESS)
2015-04-12 21:42:31,591 [ 683090] INFO - j.compiler.server.BuildManager - Using preloaded build process to compile C:\home\Willem\proj\play\comply\scala
2015-04-12 21:42:42,064 [ 693563] INFO - lij.compiler.impl.CompilerUtil - COMPILATION FINISHED (BUILD PROCESS); Errors: 0; warnings: 0 took 10483 ms: 0 min 10sec
2015-04-12 21:42:42,253 [ 693752] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: /C:/Program Files (x86)/JetBrains/IDEA/14/lib/jps-launcher.jar;C:/app/java/jdk/7/u67/lib/tools.jar;/C:/Program Files (x86)/JetBrains/IDEA/14/lib/optimizedFileManager.jar;C:/Program Files (x86)/JetBrains/IDEA/14/lib/ecj-4.4.jar
import org.scalatest._
class User(var user:String){
def this() = this(null)
override def toString = user
}
class OrientSpec extends FlatSpec with Matchers {
"A User" should "be persisted" in {
val user = new User("Willem")
user.toString() should be ("Willem")
}
}
Attachment(s):
scala2.png
scala1.png
Please sign in to leave a comment.
I just tested this with a non Play Scala project and it compiles and runs in no time.
I've upped the memory
-Xms128m
-Xmx4096m
-XX:MaxPermSize=1024m
Occurs under both 32 and 64 bit modes.
hope> /cygdrive/c/app/java/jdk/7/u67/bin/java.exe -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
hope> java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) Client VM (build 25.25-b02, mixed mode)
Intellij is picking up the correct java versions as seen in Help->about
Windows 7 os.
Hello,
can you see messages from sbt (like 'Loading project definition' etc) among compilation messages?
Thanks for the response Dmitry.
I have resolved this.
The issue with it taking 10s to run even with no changes resolved itself :p
I ran it a week later and it runs snappily.
It was still taking a long time to make so I tried a bunch of different settings and and the attached screenshots show the settings I now use. Compilation times are now down to 4-5s which is a huge improvement.
I've attached a bunch of screenshots for anyone who comes across this thread so you can replicate my settings.
One big improvement comes from adding to the build.sbt
This prevents the dependencies from being resolved every time. If you alter the dependencies you'll need to comment these out for them to be updated.
All building and running is being done from intellij - not activator.
Cheers,
Will
Attachment(s):
scala6.png
scala4.png
scala3.png
scala2.png
scala1.png
three more screenshots
Attachment(s):
scala7.png
scala6.png
scala5.png