3 ms·
Compile times are crazy, even worse than Rust in my experience.
by GardenLetter27 2y ago
Compile times are crazy, even worse than Rust in my experience.
- brodo 2y agoRust compile times are not as bad as they used to be.
- jghn 2y agoNeither are Scala's
- pkolaczk 2y agoAny links to benchmarks? Rust publishes their performance data: https://perf.rust-lang.org/dashboard.html https://perf.rust-lang.org/dashboard.html Where do I find similar thing for scala?
- sideeffffect 2y agohttps://dotty-bench.epfl.ch/ https://dotty-bench.epfl.ch/
- pkolaczk 2y agoBut it doesn’t confirm improving the speed of the compiler at all. Looks like the trend is flat. This comment from Odersky also says that Dotty was not automatically faster than 2.12: https://news.ycombinator.com/item?id=16884317 https://news.ycombinator.com/item?id=16884317
- dionian 2y agoincremental compiler makes this mostly a non-issue
- sideeffffect 2y ago> Compile times are crazy This is also heavily influenced by the build too you use. Don't use sbt or Maven or Gradle. Use the good stuff. Use Mill. https://mill-build.org/mill/comparisons/why-mill.html#_performance https://mill-build.org/mill/comparisons/why-mill.html#_perfo... Or Bleep, if you're feeling more experimental https://bleep.build/ https://bleep.build/ .
- ATMLOTTOBEER 2y agoThis isn't actually true - and I'm a mill enjoyer. Mill is roughly as fast as SBT in terms of compiling your project. See the mill x sbt comparison. https://mill-build.org/mill/comparisons/sbt.html https://mill-build.org/mill/comparisons/sbt.html SBT does suck for other reasons, however.
- pkolaczk 2y agoThat's not a big offense to Scala, honestly. It's easy to be worse than Rust. Rustc in my experience is an extremely well optimized compiler, only second to Go. It beats pure Java with Maven / Gradle as well. It gets bad reputation because Rust projects are compiled fully from source, so Rustc has usually like 100x more code to compile than in languages which use binary dependencies. fclones is ~500k LOC gross with all dependencies. Takes 9 seconds to cold compile with linking on my machine. I haven't used Scala for a while but last time we used it (Scala 2.12 + gradle) the compile times were just abysmal. A project containing just about 20k lines of Scala + some Java took over 5 minutes to build, and incremental compilation didn't work at all (probably due to Gradle not understanding Scala dependencies).
- gf000 2y ago> It beats pure Java with Maven / Gradle as well. I don't think that checks out. Java's compilation is ridiculously fast. https://mill-build.org/blog/1-java-compile.html https://mill-build.org/blog/1-java-compile.html According to this, javac itself can compile up to 100k lines per second, while Maven/Gradle is an order of magnitude slower. The only info I found for Rust mentions something along the 5k lines/second mark (on a different computer), but it is at most roughly the same, if not slower than a java build tool.
- pkolaczk 2y agoJava compilation may be ridiculously fast, but maven/gradle makes it crawl. > The only info I found for Rust mentions something along the 5k lines/second mark (on a different computer) On Pentium III? Let's see how it performs on M3 Pro: cargo loc --filter-platform=aarch64-apple-darwin ... Total lines: 961318 (783408 code, 77484 comments, 100426 blank lines) cargo clean cargo build Compiling libc v0.2.155 Compiling autocfg v1.1.0 Compiling cfg-if v1.0.0 Compiling proc-macro2 v1.0.69 Compiling unicode-ident v1.0.12 Compiling memchr v2.6.4 ... Compiling dtparse v2.0.0 Compiling fclones v0.35.0 (/Users/piotr/Projects/fclones/fclones) Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.75s Looks like it is about 80k LOC/s. Not bad. If pure javac can also do 100k LOC/s (which is definitely something I believe is possible) but then "Maven/Gradle is an order of magnitude slower" then my point stands. No-one uses pure javac to compile big projects.