this post was submitted on 24 Mar 2024
22 points (92.3% liked)

Rust

5915 readers
19 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

[email protected]

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 9 points 7 months ago (6 children)

Users can now use Cranelift as the code-generation backend for debug builds of projects written in Rust

Didn't read the rest. But this is clearly inaccurate, as most Rustaceans probably already know.

Cranelift can be used in release builds. The performance is not competitive with LLVM. But some projects are completely useless (too slow) when built with the debug profile. So, some of us use a special release profile where Cranelift backend is used, and debug symbols are not stripped. This way, one can enjoy a quicker edit/compile/debug cycle with usable, if not the best, performance in built binaries.

[–] [email protected] 3 points 7 months ago (1 children)

Another option is to compile dependencies with LLVM and optimizations, which will likely be done only once in the first clean build, and then compile your main binary with Cranelift, thus getting the juicy fast compile times without having to worry about the slow dependencies.

[–] [email protected] 1 points 7 months ago

Yes. And to complete the pro tips, the choice of linker can be very relevant. Using mold would come recommended nowadays.

load more comments (4 replies)