Open milibopp opened 6 years ago
As far as I know, they don't actually help with inlining, since generic functions are instantiated for each type during monomorphization.
My intuition was that although generic functions are instantiated for each type during monomorphization, inlining attributes should apply to those instantiations. After a brief experiment on Compiler Explorer, I'm less sure of that position; ample application of #[inline(never)]
did not seem to have any effect.
Should
#[inline]
tags be present on generic functions? As far as I know, they don't actually help with inlining, since generic functions are instantiated for each type during monomorphization. However, they may actually incur a cost on compile times, which are quite long for nalgebra.The above statements should be tested with benchmarks, before doing anything about this, of course. Is there an argument for why the annotations should stay or are they just present out of habit?
EDIT: typo