Regular compilation with Scala compiler is really slow. Most of the time is spent compiling parts of Scala libraries, instead of your own code though. Solution is to use fsc (fast scala compiler), which is daemon that compiles the required Scala libraries on the first compilation, and stays in memory after that, so your subsequent compilations after a lot faster.
My first guess was to just click the checkbox “Use fsc” in the Scala plugin settings page. This alone only causes exceptions. You also need to create a Scala compilation server instance for yourself.
- Open the 'Edit (Run/Debug) Configurations' dialog
- Click on the [+] in left top corner of the window
- Select 'Scala Compilation Server' (should be near the end of the list)
- Give the new launcher a name (e.g. 'my fsc server') and hit OK
- Press the Play icon to compile and run as usual.
Your second press of Play should be a lot faster!