Rust Lands Experimental Cranelift-Based Code Generator - Much Faster Debug Build Times
Landing yesterday within the Rust code-base is the initial version of a Cranelift code generator back-end. By leveraging the Cranelift code generator that is developed as part of the Bytecode Alliance for WebAssembly, Rustc with Cranelift can experince much faster debug builds.
The pull request adding rustc_codegen_cranelift as an alternative code generator for the Rust compiler has been merged. When compiling Rust code with the debug mode set, this has the potential of speeding up compile times by 20~30% compared to the debug mode LLVM builds.
Cranelift is the code generator taking target-independent IR and translating into executable machine code. Cranelift is principally focused on WebAssembly but has seen interest elsewhere. Cranelift so far is principally focused on x86_64 support with other CPU architectures at various stages of support. Cranelift has also been explored as a possible back-end for the IonMonkey JavaScript compiler within Firefox and for WebAssembly with Firefox's SpiderMonkey engine.
The non-default, experimental Cranelift back-end for Rust is now merged. The rustc_codegen_cranelift repository also saw its initial version (v0.1.0) to mark the milestone. At this point its primary benefit seems to be over faster debug build times but not for release builds or the resulting binary performance, but we'll see in time as Cranelift matures and is supported more broadly how well it continues performing.
This Cranelift documentation provides a comparison how they view themselves compared to LLVM.
The pull request adding rustc_codegen_cranelift as an alternative code generator for the Rust compiler has been merged. When compiling Rust code with the debug mode set, this has the potential of speeding up compile times by 20~30% compared to the debug mode LLVM builds.
Cranelift is the code generator taking target-independent IR and translating into executable machine code. Cranelift is principally focused on WebAssembly but has seen interest elsewhere. Cranelift so far is principally focused on x86_64 support with other CPU architectures at various stages of support. Cranelift has also been explored as a possible back-end for the IonMonkey JavaScript compiler within Firefox and for WebAssembly with Firefox's SpiderMonkey engine.
The non-default, experimental Cranelift back-end for Rust is now merged. The rustc_codegen_cranelift repository also saw its initial version (v0.1.0) to mark the milestone. At this point its primary benefit seems to be over faster debug build times but not for release builds or the resulting binary performance, but we'll see in time as Cranelift matures and is supported more broadly how well it continues performing.
This Cranelift documentation provides a comparison how they view themselves compared to LLVM.
7 Comments