Rust compiler combined with Cranelift significantly reduces debug build time

Rust's newly merged PR shows that rustc_codegen_cranelift has become an alternative to the Rust compiler's code generator.

rustc_codegen_cranelift is a code generator backend based on Cranelift, currently in the experimental stage. Cranelift is part of the WebAssembly bytecode alliance .

According to the introduction of the PR submitter , using Cranelift's Rustc can achieve faster debugging builds. When the Rust code is compiled in debug mode, the compilation time of the purely compiled version is about 20-30 shorter than that of LLVM build in debug mode. %.

Cranelift is a code generator that translates target-independent IR into executable machine code. Cranelift mainly focuses on the WebAssembly field, but it has also aroused interest in other places. So far, Cranelift has mainly focused on providing support for x86_64, and other CPU architectures are also in different stages of support. In addition, Cranelift has also been explored for the possibility of being used as the back end of the IonMonkey JavaScript compiler in Firefox and the WebAssembly back end of the Firefox SpiderMonkey engine.

rustc_codegen_cranelift was merged as Rust's non-default experimental Cranelift backend, and its GitHub repo recently released the initial version  v0.1.0  to commemorate it.

It seems that the advantage of rustc_codegen_cranelift is mainly reflected in the optimization of the debugging build time, rather than the release build or the resulting binary performance. Of course, as Cranelift matures, I believe it will provide broader support.

Check out the Cranelift documentation to describe how you compare with LLVM .

Guess you like

Origin www.oschina.net/news/119524/rust-cranelift-merged