News for hackers. Stuff that matters.
Re:Rust – Faster compilation with the parallel front-end in ... by darthrupert on Friday November 10, 2023 @06:46AM (#38217724)
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.

Re:Rust – Faster compilation with the parallel front-end in ... by mpartel on Friday November 10, 2023 @06:51AM (#38217767)
Compilation times depend very heavily on the amount/size/complexity of dependencies.
Re:Rust – Faster compilation with the parallel front-end in ... by nicoburns on Friday November 10, 2023 @07:15AM (#38217938)
And also processor speed.
Re:Rust – Faster compilation with the parallel front-end in ... by the_duke on Friday November 10, 2023 @08:03AM (#38218308)
And 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.

Re:Rust – Faster compilation with the parallel front-end in ... by epage on Friday November 10, 2023 @09:06AM (#38218971)
I 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.

Re:Rust – Faster compilation with the parallel front-end in ... by the_duke on Friday November 10, 2023 @09:18AM (#38219138)
Oh that time is already with mold.

Default linker is quite a bit slower.

Re:Rust – Faster compilation with the parallel front-end in ... by darthrupert on Saturday November 11, 2023 @02:43AM (#38228352)
My 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.

Re:Rust – Faster compilation with the parallel front-end in ... by mpartel on Saturday November 11, 2023 @05:01AM (#38228911)
To 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.
Re:Rust – Faster compilation with the parallel front-end in ... by Hamuko on Friday November 10, 2023 @06:55AM (#38217798)
My 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.
Re:Rust – Faster compilation with the parallel front-end in ... by madiele on Friday November 10, 2023 @08:29AM (#38218529)
If 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

Re:Rust – Faster compilation with the parallel front-end in ... by pdimitar on Saturday November 11, 2023 @01:40PM (#38233151)
Can you post a link, please?