3 ms·
Well Scala programs only get half compiled at command time, the other half is JIT at runtime. But no not hours bad.. but say a 3 minute partial compile for a 1
by brianwawok 10y ago
Well Scala programs only get half compiled at command time, the other half is JIT at runtime.
But no not hours bad.. but say a 3 minute partial compile for a 1 line change is enough to kill your dev cycle. (Not sure it is 3 minutes bad for most projects these days, but its very hard to have a 2 second Scala compile)
- pkolaczk 10y agoYou get much better compile times if you keep scala compiler running in daemon mode (in SBT or IDEA; AFAIK Gradle can't do this yet), so it gets more benefits from JVM HotSpot. It makes a tremendous difference (up to 10x) on larger code bases and in fact, I often get 1-5s incremental compile times on a 20 kLOC codebase. Another trick is to modularize the project and enable parallel compilation to speed up compiling everything from scratch. As for C++ compile times, the major culprit are templates. Changing a single line of the implementation of a template requires to recompile all code using that template. Scala does not have this problem, because it has generics for most of the things that C++ templates are used, and generics support separate compilation.
- brianwawok 10y agoDaemon does help a bit. Gradle definitely has a daemon: https://docs.gradle.org/current/userguide/gradle_daemon.html https://docs.gradle.org/current/userguide/gradle_daemon.html I think in Scala you can do similar "must recompile all" if you do things like change a global implicit. > I often get 1-5s incremental compile times on a 20 kLOC codebase 20k is still toy project size though. Try incremental compile with 100k or 200k LOC. It gets bad.
- pkolaczk 10y agoGradle has a daemon, but I have some doubts if it really keeps scalac hot in memory. Last time I tried Gradle was weirdly slow with scala incremental compilation, while SBT worked like a breeze. As for compiling 200k LOC - just split it into modules with sane dependencies and then you don't have that problem. > I think in Scala you can do similar "must recompile all" if you do things like change a global implicit. But there is a world of a difference between changing a signature of an implicit than changing an implementation of a template. If you change the implementation of an implicit, the only thing that needs recompiling is the class defining the implicit, nothing more.
- pjmlp 10y agoSo it is not Delphi, but I still find it quite fast.