0

After reading slow compiler and Martin Odersky's response, We are so worried to kick start massive ERP product (which is heavily funded that targets a specific Industry) using Scala language.

Edited based on below responses: Splitting into different modules is an option. But that is how one should be doing/planing in any large projects. That just cant be the solution for us.

Martin himself admitted (please see above link) that the Java compiler is 10 times faster than Scala (almost two years ago). This is scary for us, we cant afford waiting for hours while it builds (e.g when we do the clean build) on Dev's machine. Martin clearly said not expect any miracles in future.


Our only option is using continuous compilation. Our intended IDE is IntelliJ Idea.

  1. I am not sure how it is going to affect developer's machine/Ide's performance?
  2. Also when I click save, does it also try compile the code file I am currently busy writing?

Some guidance is really appreciated.

Thanks
Mk

Community
  • 1
  • 1
  • That question on slow compiler was asked in 2010 you really think that in this three years nothing has changed? – 4lex1v Aug 24 '13 at 08:07
  • Thanks for your comment. It must have improved definitely. But as per Martin's answer, it will remain slow and not to expect any miracles in future. – Murali Krishna Aug 24 '13 at 08:32
  • 1
    Well i can say that we are developing, not a massive, but about 10 module, health care RESTful system on top of Akka + Spray, and currently it takes about 25 minutes in Jenkins on clean/compile/test tasks – 4lex1v Aug 24 '13 at 08:53
  • Thank you for the reply again. That sounds comfortable for me already. Can you please tell how much time it takes to compile the same solution on Developer machine? – Murali Krishna Aug 24 '13 at 09:10
  • We are using DigitalOcean as Dev Server, as for local machine that really depends on my goals, don't forget that SBT is using incremental compilation + JRebel + sbt-revolver plugin, so it's really quick, as for full clean/compile/test task maybe 20 minutes on mac-mini – 4lex1v Aug 24 '13 at 09:46
  • 3
    you may want to have a look at Pants and how it was used to massively reduce build time for a large scala projet by enforcing good SoC inside a project http://www.youtube.com/watch?v=ukqke8iTuH0 you can reach the same benefits by discipline using any build tool – Jean Aug 24 '13 at 13:40

1 Answers1

2

Compilation speed is definitely not one of Scala's strengths, but you can potentially limit how much it affects you by structuring a large project as a set of smaller ones with a tree-like dependency (e.g. core utilities; core library which depends only on those utilities; database interface which depends on core and external database library; etc.). Then during most development cycles you can pretend you're working with a smaller project and reserve larger builds for relatively rare events.

My largest project is fairly small (under 5 minutes compile time; 40k LOC), but even so I have it subdivided in such a fashion which means that I rarely have to wait longer than a minute for anything to complete. It does require some discipline to maintain, and some refactoring (as I move common blocks of code from leaves of the tree, where it was fast to recompile, to a root instead of duplicating it), but has worked well for me.

Rex Kerr
  • 166,841
  • 26
  • 322
  • 407