3 ms·
I don't get the compile speed hate. Rust compilation is inconceivably fast to me. Like what are you incrementally compiling that takes you out of the dev flow?
by rowanG077 4y ago
I don't get the compile speed hate. Rust compilation is inconceivably fast to me. Like what are you incrementally compiling that takes you out of the dev flow?
- errantmind 4y agoLinking is often the slow part for large projects. Switching to the Mold linker can help some, but it can still be relatively slow on a lot of hardware. Overall I agree with you though, it isn't slow enough on my hardware to interrupt my dev-flow.
- cstrahan 4y agoDepending on what part I touch, a recompile is 20 to 60 seconds. This is a project at work — an HTTP server that runs some stuff on an interpreted language we’ve developed in-house. Not the end of the world, but a bit annoying nonetheless.
- insanitybit 4y agoIs that just running `cargo check`? There's a pretty solid profiler that I've used before to identify slow parts of a build and address them. https://blog.rust-lang.org/inside-rust/2020/02/25/intro-rustc-self-profile.html#profiling-the-compiler https://blog.rust-lang.org/inside-rust/2020/02/25/intro-rust...
- slondr 4y agoOn my phone a Rust program of significant size can take multiple hours to finish compiling, where a C program of comparable size would take about an hour or slightly less. No reason to discard the language, for sure, and I don't avoid compiling from source even on this machine, but it's definitely worse than C.
- woodruffw 4y agoMaybe this is a silly question, but why are you compiling Rust programs on a smartphone?
- Gigachad 4y agoNot the same person, but programming on phones with Bluetooth keyboards is very common for people learning in developing countries since everyone has a phone, and many do not have a laptop.
- woodruffw 4y agoI didn't know that, thanks for the explanation! I can absolutely see slow compilations being a problem in that setting.
- echelon 4y agoI have a Rust monorepo with about a dozen microservice apps and two dozen shared libraries. The compile times are inconvenient, to put it mildly. Production release builds take approximately 40 minutes and are especially painful when I forget to codegen the SQL schema definitions (sqlx). At some point I need to invest in CI devops and use Bazel build caching. Pain aside, the ability to share code is glorious. Clion + Rust plugin does a tremendous job navigating it all.
- pas 4y agofor CI have you tried to use buildkit persistent runners with caching + https://github.com/LukeMathWalker/cargo-chef https://github.com/LukeMathWalker/cargo-chef ?
- Gigachad 4y agoIt’s always the libraries that do it. It’s pretty easy to pull in enough library code that your own app code is nothing compared to compiling the web server and ORM you imported. But even then I haven’t seen it as that much of an issue.