How to speed up the Scala IDE?

I work with a rather large project that SBT manages (total recompilation time is 150 + sec). I use the latest Scala IDE plugin (4.0.0-M1), and I can barely edit any large enough source file - every time I print something, the eclipse completely freezes for a couple of seconds. The same thing happens when I save my changes. It also seems that the editing file leads to poor performance. Restarting Eclipse helps, but not for long. To work with this, I have to open the .scala source file in a text editor through Eclipse, losing all the benefits of the Scala editor.

Additional Information

PC is good enough - Intel Core i5-3570 with 16 GB of RAM

I am using Windows 7 x64, Scala 2.10.3, SBT 0.13.1 and Oracle JDK 1.7.0u45

Using profiling with Java VisualVM shows that the processor seems to be used by the Scala compiler: Java VisualVM output

The Eclipse heap status indicator never goes beyond half.

Auto-build, deceleration of selection and marking are all disabled.

Configuration from eclipse.ini (last 3 flags added from http://scala-ide.org/docs/current-user-doc/advancedsetup/index.html ):

 -vm D:\ProgramFiles\Java\jdk1.7.0_45\bin\javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.6 -Xms1024m -Xmx2048m -Xss1M -XX:MaxPermSize=1024M -server -XX:+DoEscapeAnalysis -XX:+UseConcMarkSweepGC -XX:+UseCompressedOops 
+6
source share
6 answers

For posterity. The offender was the Mylyn plugin, trying to find out the exact information about what is under the cursor at each keystroke and in the user interface stream. For more information, see Ticket # 1002129 .

+3
source

I did not try the new Scala Eclipse IDE, but my options were -Xms2g -Xmx8g one year ago. I used it for a significant but not huge project on a Mac i7quad / 8GB, but still it was slow ...

In the end, I decided to compile only after saving the file.

So maybe you should try:

  • increase heap size as above
  • try the -d64 option if it exists on your platform
  • uncheck the box "Report input problems" (Preferences> Java> Editor)

for the latter, as well as whether it disables the presentation compiler, I am not sure; but it certainly does not cause him as much as possible.

+3
source

If a view compiler takes such a long time, the source of the slowdown may be your code, not the tools that work on it.

Divergent implications are sometimes the culprits of type checking timings, becoming cumbersome. Have you tried compiling with Xlog-implicits ? You can also use the IDE functions to indicate implicit use in your code .

+2
source

Try the intellij community (not a blatant answer). It is faster than Eclipse. Also, even in intelliJ, I sometimes have to share files when they become too large for the IDE.

+1
source

You can turn off auto build. Uncheck Project > Build Automatically in the menu.

Each time you save the source file, Eclipse will save your file, but will not try to create a workspace, as if this checkbox were checked.

To force build, press Ctrl - B or Cmd - B on Mac. If you use the problem representation, there are 2 classes of problems - those that require saving, and those that require saving + recompilation. So, if you see that the problem does not disappear after saving, but you think that this is not the problem, just rebuild.

This is what I did in Eclipse when developing large Java projects before SSDs and multi-core processors.

+1
source

With the recommended default configuration, I simply remove the "code recommendation" plugin and return "Activation triggers for java" only to ".". Now it works much faster.

0
source

All Articles