Stream: cranelift

Topic: cranelift cpu utilization


view this post on Zulip bjorn3 (Apr 07 2022 at 19:50):

I have been benchmarking rustc with llvm and cg_clif today. One fun thing I noticed is that the cpu-clock metric when comparing cg_llvm and cg_clif improves more than the instruction count. This seems to suggest that Cranelift has a slightly higher ipc than LLVM.

view this post on Zulip Chris Fallin (Apr 07 2022 at 20:11):

Interesting, thanks for measuring that! I suspect this may be due to better cache locality (LLVM has heavily pointer-based IR data structures, Cranelift is largely index-based with dense arrays)

view this post on Zulip Charly Castes (Apr 08 2022 at 15:57):

It might also be due to bound checks. I noticed the same behavior when benchmarking a Rust app and it's C++ equivalent: the Rust one had a bound check on the critical path, increasing the instructions count but not the cpu time thanks to branch prediction.


Last updated: Nov 22 2024 at 16:03 UTC