Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to speed up Scala IDE?

I'm working with a fairly large project, managed by SBT (full recompilation time 150+ sec). I'm using latest Scala IDE plugin (4.0.0-M1) and I can barely edit any large enough source file - each time I type something, eclipse freezes completely for a couple of seconds. Same happens when I save my changes. It also seems that editing file cause more and more heavy performance degrade. Restarting Eclipse helps, but not for long. To work this around, I have to open a .scala source file in text editor via Eclipse, losing all benefits of Scala editor.

Additional info

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

I'm 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 apparently CPU is used by Scala presentation compiler: Java VisualVM output

Eclipse's heap status indicator never goes beyond a half.

Auto-build, implicits highlight and mark occurences are all turned off

Configuration from eclipse.ini (3 last flags are 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
like image 986
Alex Abdugafarov Avatar asked Apr 30 '14 07:04

Alex Abdugafarov


2 Answers

For posterity. The culprit was the Mylyn plugin trying to find out precise information on what's under the cursor on every keystroke and on the UI thread. For details, see ticket #1002129.

like image 163
Iulian Dragos Avatar answered Sep 20 '22 16:09

Iulian Dragos


I haven't tried the new Scala Eclipse IDE, but my opts were -Xms2g -Xmx8g one year back. I was using it for a sizeable, but not huge, project on a Mac i7quad/8GB and yet it was slow...

Eventually I decided to compile only upon saving the file.

So maybe you should try those:

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

for the last one, how and whether that disables the presentation compiler, I'm not sure; but that certainly doesn't invoke it as much.

like image 31
eruve Avatar answered Sep 19 '22 16:09

eruve