Performance Tips for Scala IDE for Eclipse

Performance Tips for Scala IDE for Eclipse

Last updated:

UPDATE - I ended up just using Intellij IDEA for Scala. I've had no problems with it at all.

So you've started playing with Scala, maybe took part in an MOOC or two and you now feel you're ready to start your next project using this language.

You downloaded Eclipse and started coding away and you are feeling good that you're able to combine nice, elegant functional programming with getting real work done.

However, there quickly comes a time when Eclipse starts behaving sluggishly, very slowly at times. You start being afraid to hit Ctrl+Shift+F (reformat code), Ctrl+Space (intelissense, autocomplete) and you fear the moment when you need to Ctrl+S (save your code).

The Scala Plugin for Eclipse can make the IDE very slow and heavy, particularly as your project grows in size. But don't give up on Scala just yet: there's a few tricks you can do to make wiritng Scala code fun again.

HEADS-UP The first thing you should do is disable Build Automatically! You don't need automatic builds to make use of the IDE's syntax and type checker!

Eclipse.ini settings

This is an example eclipse.inifile. It should be placed in the same folder as the eclipse executable.

-clean
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.v20140116-2212
-vmargs
-server
-Xmx1600m
-Xms300m
-XX:MaxPermSize=512m
-XX:+UseParallelGC

Run "Build workspace" in background by default

WindowPreferencesGeneralAlways run in background

Keeping files small

This is practical as well as strategic advice: keeping each single unit of code (be it a class, trait or method) small helps Eclipse validate your code more quickly and also helps you keep your code modular and DRY.

Enable Manual Garbage Collection from the IDE UI

So you can see if things are going astray and trigger a manual GC if needed.

WindowPreferencesGeneralShow heap status

(to force a garbage collection, click on the little rubbish bin next to the heap status bar)

Other resources