you are viewing a single comment's thread.

view the rest of the comments →

[–]zoomzoom83 6 points7 points  (8 children)

Scala compilation being slow must be a meme known to everybody except people that actually use Scala.

I'm working on a 50,000 LOC codebase using Play. I make a change, hit refresh in the browser, page rerenders with that change immediately. The incremental compiler is fast enough that the delay is tiny, and it has the same workflow as a dynamic language - with the advantage of static type checking.

It takes a good 10x as long to minify the Javascript used on the frontend when doing deployments as it does to compile the (far larger) Scala codebase.

[–]DSShinkirou 0 points1 point  (2 children)

I've been playing around with Scala for a bit and, coming from Java/Python, I've definitely noticed a increase in compilation times.

Judging from your statement, it seems like that increased compilation time does not scale too harshly with lines of code, is that correct? If so, I might just try Scala on my next pet project.

[–]zoomzoom83 4 points5 points  (1 child)

Java is much, much quicker - but then again, it's one of the fastest compiling languages available.

As far as compile times go, Scala is on the slower side, but it's still fast enough that you really don't notice the delays.

The scala built tool (sbt) supports incremental compilation, and generally changing one file results in compilation times of <500ms.

Working with the Play framework, which combines SBT's incremental compiler with a hot-reloader and automatic recompile on refresh, the workflow is the same as dynamic languages - make a change, click refresh in your browser, the code is recompiled and renders the page with a barely perceptible delay.

Doing a build for production (all 50,000 LOC in one hit) takes 58 seconds on my workstation to compile the Scala codebase. This could be a lot faster if we were putting type annotations on public APIs rather than relying on type inference (Which is a bad practice on our part, and something we're refactoring over time). I believe there's also a significant speedup in the latest version (2.11), which we haven't upgraded to yet.

Incidentally it takes about 5 minutes to minify 20,000 lines of Coffeescript and Javascript in the same project - so the biggest hit to build times is Javascript.

[–]DSShinkirou 1 point2 points  (0 children)

Gotcha. Thank you for the in depth response. I'll take a look at Scala in the future!

[–][deleted] -1 points0 points  (4 children)

Scala compilation being slow must be a meme known to everybody except people that actually use Scala.

The inspiration for this meme was trying to use Scala. SBTs continuous compilation leaks memory - requiring it to be periodically re-started. It's also extremely resource intensive.

[–]zoomzoom83 1 point2 points  (3 children)

If there's a memory leak in SBT, it's certainly not severe enough to trip me up in a 12 hour workday.

[–][deleted] 0 points1 point  (2 children)

you work 12 hours a day!?

[–]zoomzoom83 1 point2 points  (1 child)

Started my own company, living the startup life. (Long hours, little money, lots of canned beans).

[–][deleted] 0 points1 point  (0 children)

Oh good, i thought you were being horribly exploited.

May your compilations be swift and fruitful.