4 ms·
I've been away from doing Rust semi-actively for a few years, and have been working in other environments like python and Typescript. Now I tried it for a proje
by darthrupert 3y ago
I've been away from doing Rust semi-actively for a few years, and have been working in other environments like python and Typescript. Now I tried it for a project for a while again and the compilation speed is pretty much instant. It's always great when things get better, but things are pretty damned good already.
Also, these days it's possible to use cheat codes aka ChatGPT to flounder through almost all the difficult Rust problems that might have been show stoppers a few years ago. It's looking pretty great on that side of the fence.
- mpartel 3y agoCompilation times depend very heavily on the amount/size/complexity of dependencies.
- nicoburns 3y agoAnd also processor speed.
- the_duke 3y agoAnd on having a fast CPU, RAM and disk. It makes a huge difference. For what it's worth, I'm working on a project with about 1000 dependencies and incremental debug build time is about 4 seconds on my laptop. That's already pretty good.
- epage 3y agoI know you said 4s is good but have you tried changing the linker? Number of dependencies likely won't affect incremental build times except for linking and replacing it might offer some good gains for incremental builds.
- the_duke 3y agoOh that time is already with mold. Default linker is quite a bit slower.
- darthrupert 3y agoMy project isn't large or even mid-sized, but it has over a hundred dependencies. Building the dependencies certainly takes some time on my raspberry pi 4, but after that initial hit, every change to the project builds a release in about 15 seconds, and a debug build in about 10. And on my Macbook Air M2, where I actually develop, these things happen fast enough to call them instant. Perhaps I'm a bit spoiled there due to the excellent hardware. As a comparison, a Typescript project I'm working on using a more powerful Macbook always takes about 5-10 seconds to build. I don't doubt that actually large Rust projects take a long time to build, though, but even these small and mid-sized were rather slow to build a few years ago.
- mpartel 3y agoTo clarify, dependencies significantly affect incremental builds too. Seems loading information about compiled dependencies into the compiler and/or resolving stuff about them can take significant time.
- Hamuko 3y agoMy compilation times are otherwise great except when I make cross-arch Docker images in GitHub Actions. Then I'm seeing Docker image builds take 60 to 90 minutes. Has made me quite aware of just how many dependencies my projects have in total.
- madiele 3y agoIf you are using buildx+QEMU for compiling your much better off cross-compiling inside the native architecture of github actions and the export the result to a build step that emulates the architecture: I went form cross compilation that took 2 hours to 10 minutes total You can follow my Dockerfile of my project as an example on how to do it
- pdimitar 3y agoCan you post a link, please?