Stream: cranelift

Topic: Cranelift Rust frontends


view this post on Zulip Viktar Makouski (Oct 17 2023 at 10:56):

Does cranelift have any rust frontends with enabled compiler optimizations? I found only this one https://github.com/bjorn3/rustc_codegen_cranelift but, as I understand it supports only debug mode.
Maybe some community ones?

Cranelift based backend for rustc. Contribute to bjorn3/rustc_codegen_cranelift development by creating an account on GitHub.

view this post on Zulip Afonso Bordado (Oct 17 2023 at 10:59):

:wave: Hey, As far as I understand cg_clif should support release mode, did you find any issue with it?

view this post on Zulip Viktar Makouski (Oct 17 2023 at 11:05):

Oh, it really works, sorry for that

view this post on Zulip Andrei Kashin (akashin) (Nov 17 2023 at 14:04):

As a follow up here, we ran a few benchmarks comparing the execution performance of Rust code compiled with rustc_codegen_cranelift in release mode vs using rustc to compile to WASM target and then using wasmtime to execute that WASM and we're seeing >20x difference on benchmark that computes number pi.
Is this expected? What could explain such massive difference in performance?

You can find the exact steps we took in the benchmark here
as well as full comparison table and the code of the benchmark

Contribute to MCJOHN974/bench development by creating an account on GitHub.

view this post on Zulip Alex Crichton (Nov 17 2023 at 16:00):

My guess as to what you're seeing is the difference that an optimizing compiler makes. Cranelift doesn't perform the same degree of optimization that LLVM does, so by taking it out of the picture you're missing out on things like inlining for example.


Last updated: Nov 22 2024 at 17:03 UTC