3 ms·
It's been proposed before: https://internals.rust-lang.org/t/idea-polymorphic-baseline-codegen/8313 https://internals.rust-lang.org/t/idea-polymorphic-baseline-
by bbatha 8y ago
It's been proposed before: https://internals.rust-lang.org/t/idea-polymorphic-baseline-codegen/8313 https://internals.rust-lang.org/t/idea-polymorphic-baseline-...
Its also fairly common to have code like:
fn do_it(a: impl AsRef<i32>) {
let a = a.as_ref();
// do something with a
}
That could be instead monomorphised to be
fn _do_it(a: &i32) {
// do something with a
}
fn do_it(a: impl AsRef<i32>) {
let a = a.as_ref();
_do_it(a)
}
saving the inlining of _do_it's code bloat/generation penalty.
- nicoburns 8y agoHmm, interesting the Niko thinks that MIR optimisation passes and CraneLift are more likely to happen soon. I so dearly want faster Rust compile times!