You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is very common to clutter libraries with #[inline] annotations on small/trivial functions to ensure that they optimize well. It shouldn't really be necessary to do this by hand so often. Instead, the compiler could use its inlining heuristic (which already exists for the MIR inliner) to decide when it is likely to be beneficial to make a function inlineable.
I'd appreciate if there were a way to get the current behavior then — something between #[inline(never)] and #[inline]... Avoiding #[inline] can substantially improve compile times.
I stand by what I said here — but at the same time I did just go through the (tedious) process of manually adding this to a crate that had very few #[inline] annotations in rusqlite/rusqlite#834
Activity
thomcc commentedon Oct 23, 2020
I'd appreciate if there were a way to get the current behavior then — something between
#[inline(never)]and#[inline]... Avoiding#[inline]can substantially improve compile times.That said supporting this complicates this issue.
thomcc commentedon Nov 4, 2020
I stand by what I said here — but at the same time I did just go through the (tedious) process of manually adding this to a crate that had very few
#[inline]annotations in rusqlite/rusqlite#834jonas-schievink commentedon Nov 4, 2020
I wonder if doing this plus MIR inlining might not end up improving compile times. This is only about small functions, after all.
mati865 commentedon Mar 11, 2021
What is the current status on this (or how to push it forward)?
Looking at #70550 the MIR inliner seems to already have what it needs but it's not enabled yet.
bjorn3 commentedon Mar 12, 2021
We do not currentlt store the MIR for non-
#[inline]and non-generic functions in the crate metadata as necessary for inlining cross-crate.tmiasko commentedon Nov 14, 2023
Implemented in #116505.