I'm fairly sure this isn't about memory and it has not materially changed in the last release (23488). My RAM allocation (256) is much higher than IDEA is actually using (~150). It's a matter of extensive (I would say extreme) amounts of computation performed after every change to the source code. By watching the CPU usage meter on my system, I can see that several seconds of CPU use are triggered by most any change to the source.
As it stands, this is a severe impediment to usability. If the total cost of the computations required to accommodate source changes can not be brought down by factor of 5 or so and they cannot be ammortized or made to not prevent the user from even interacting (selection, scrolling, everything is blocked duing these computations), then I don't think the Scala plug-in is going to be viable for IDEA. I'm putting up with this now in the hopes that it will be improved in the near future, but it is not something I can put up with indefinitely. It is very frustrating to use, as it stands.
I very much want to use iDEA for my Scala programming (I've been using it for Java since version 6 was current as well as for Groovy / Grails later on). I plan to be doing a lot of Scala programming from now on, but this performance / responsiveness problem absolutely must be solved for me to be able to do use IDEA for Scala.
I use scala plugin not only at work, where I have really good environment. I used scala plugin for my own projects, I have middle environment for this (Vista, 2 Gb RAM, AMD 2,4 x 2). And I haven't such problems with freezing or anything else. Yes, completion do not work very fast, and some other features too, but while I just type text everything is ok (with sources about 1000 files). I profiled plugin and also didn't find critical places. But of course your problems could be caused be scala plugin. So if you have possibility to help us, please profile (YourKit?) moments, when idea freeze while typing. I can't do it myself, because I can't reproduce it. Thank you.
Working on the specs project, I switched from Eclipse to IntelliJ which I also use for Java and Groovy. I just remember checking the jvm properties and setting a high-delay on "Intellisense" (I don't remember the exact option name) to get a responsive enough GUI.
Then I worked a bit with Intellij and appreciated the overall experience (editing, navigating,...)
However I switched back to Eclipse when I realized that for every small modification, the compiler was recompiling lots of unrelated files. This was a huge slow down in my productivity.
I know that this may not be an easy thing to implement but unless there is a better incremental compilation, it's going to be difficult for me to resume work with IntelliJ :-(.
Am I alone in that case, are there some improvements scheduled on the roadmap for this?
Yes, there is reparse delay option (Settings -> Editor -> Error Highlighting -> reparse delay). By default it's 300 ms. About incremental compilation. I haven't problems with incremental compilation and I think it's very hard to do something better, because of type inference feature in scala, which may produce strange bugs after small recompilation (but I think it can be better, you right). But I can suggest hint for you, I use it often. When you change just one file without major changes (deleting methods, changing signatures etc.) you can use just Ctrl+Shift+F9, which recompile one file. But when you change just one file, incremental compiler usually recompile just one file. It's my own experience. If you give us example in spec project we can try to reproduce problems and fix incremental compilation.
You can download the specs project from here, create a new Scala project (maybe with mvn idea:idea to get all the dependencies setup automatically) and compile it.
Then if you declare a configuration to run the org.specs.samples.sampleSpec1 object, you will see that the plugin is doing a new "Make" and "running phase typer, namer,... on lots of files, all unrelated to that sample specification.
There might be several causes of slow make in IntelliJ. At first, as it was mentioned, even small changes in scala classes' bodies may touch seemingly unrelated files, that's why during incremental recompilation we find a fixed point set, which contains all files, affected by changes. For another thing, core IDEA's caches are not designed to maintain dependencies for classes, which are placed not under folder hierarchy, equivalent to their package (which is normal for Scala). For example org.specs.ScalaCheck from specs project is placed in file org.specs.specification.Scalacheck.scala , which leads to its recompilation every time you're hit `make' button. One more problem of compilation of scala classes in IntelliJ is a big verbosity of an appropriate compiler process. Unfortunatelly, it's necessary for us to get some output messages (for instance, about files written to disk) which are used for caches maintainance and output to compilation progress bar. May be, you have some ideas, how to avoid this? All advices are highly appreciated.
What VM options you use in $IDEA_INSTALL_DIR/bin/idea.exe.vmoptions file?
I can recommend you to try to set this options:
-Xms92m
-Xmx512m
-XX:MaxPermSize=270m
-ea
I'm running with:
-Xms256m
-Xmx512m
-XX:MaxPermSize=150m
-ea
I'll up the maxpermsize. But I'm only playing with hello-world tests -- I have a total fo 10 scala classes in my project, including tests.
Hi,
I'm fairly sure this isn't about memory and it has not materially changed in the last release (23488). My RAM allocation (256) is much higher than IDEA is actually using (~150). It's a matter of extensive (I would say extreme) amounts of computation performed after every change to the source code. By watching the CPU usage meter on my system, I can see that several seconds of CPU use are triggered by most any change to the source.
As it stands, this is a severe impediment to usability. If the total cost of the computations required to accommodate source changes can not be brought down by factor of 5 or so and they cannot be ammortized or made to not prevent the user from even interacting (selection, scrolling, everything is blocked duing these computations), then I don't think the Scala plug-in is going to be viable for IDEA. I'm putting up with this now in the hopes that it will be improved in the near future, but it is not something I can put up with indefinitely. It is very frustrating to use, as it stands.
I very much want to use iDEA for my Scala programming (I've been using it for Java since version 6 was current as well as for Groovy / Grails later on). I plan to be doing a lot of Scala programming from now on, but this performance / responsiveness problem absolutely must be solved for me to be able to do use IDEA for Scala.
Randall Schulz
I use scala plugin not only at work, where I have really good environment. I used scala plugin for my own projects, I have middle environment for this (Vista, 2 Gb RAM, AMD 2,4 x 2). And I haven't such problems with freezing or anything else.
Yes, completion do not work very fast, and some other features too, but while I just type text everything is ok (with sources about 1000 files).
I profiled plugin and also didn't find critical places.
But of course your problems could be caused be scala plugin. So if you have possibility to help us, please profile (YourKit?) moments, when idea freeze while typing. I can't do it myself, because I can't reproduce it. Thank you.
Best regards,
Alexander Podkhalyuzin.
Hi Alexander,
I want to add a note on my own experience.
Working on the specs project, I switched from Eclipse to IntelliJ which I also use for Java and Groovy.
I just remember checking the jvm properties and setting a high-delay on "Intellisense" (I don't remember the exact option name) to get a responsive enough GUI.
Then I worked a bit with Intellij and appreciated the overall experience (editing, navigating,...)
However I switched back to Eclipse when I realized that for every small modification, the compiler was recompiling lots of unrelated files. This was a huge slow down in my productivity.
I know that this may not be an easy thing to implement but unless there is a better incremental compilation, it's going to be difficult for me to resume work with IntelliJ :-(.
Am I alone in that case, are there some improvements scheduled on the roadmap for this?
Thanks,
Eric.
Yes, there is reparse delay option (Settings -> Editor -> Error Highlighting -> reparse delay). By default it's 300 ms.
About incremental compilation. I haven't problems with incremental compilation and I think it's very hard to do something better, because of type inference feature in scala, which may produce strange bugs after small recompilation (but I think it can be better, you right). But I can suggest hint for you, I use it often. When you change just one file without major changes (deleting methods, changing signatures etc.) you can use just Ctrl+Shift+F9, which recompile one file. But when you change just one file, incremental compiler usually recompile just one file. It's my own experience.
If you give us example in spec project we can try to reproduce problems and fix incremental compilation.
Best regards,
Alexander Podkhalyuzin.
You can download the specs project from here, create a new Scala project (maybe with mvn idea:idea to get all the dependencies setup automatically) and compile it.
Then if you declare a configuration to run the org.specs.samples.sampleSpec1 object, you will see that the plugin is doing a new "Make" and "running phase typer, namer,... on lots of files, all unrelated to that sample specification.
Eric.
Hi, Eric.
There might be several causes of slow make in IntelliJ. At first, as it was mentioned, even small changes in scala classes' bodies may touch seemingly unrelated files, that's why during incremental recompilation we find a fixed point set, which contains all files, affected by changes. For another thing, core IDEA's caches are not designed to maintain dependencies for classes, which are placed not under folder hierarchy, equivalent to their package (which is normal for Scala). For example org.specs.ScalaCheck from specs project is placed in file org.specs.specification.Scalacheck.scala , which leads to its recompilation every time you're hit `make' button.
One more problem of compilation of scala classes in IntelliJ is a big verbosity of an appropriate compiler process. Unfortunatelly, it's necessary for us to get some output messages (for instance, about files written to disk) which are used for caches maintainance and output to compilation progress bar. May be, you have some ideas, how to avoid this? All advices are highly appreciated.
With best regards,
Ilya