Skip to content

Conversation

@Shnatsel
Copy link
Contributor

Using vectorize() as opposed to directly calling functions annotated #[inline(always)] is meant to introduce an inlining barrier and make the compiler make inlining decisions. Therefore putting #[inline] on it is rather pointless: if I wanted aggressive inlining, I wouldn't be calling vectorize() in the first place.

#[inline] also enables cross-crate inlining, but since vectorize() is a generic function it will be instantiated in the caller crate, so this is not a concern.

More info about inlining: https://matklad.github.io/2021/07/09/inline-in-rust.html

Motivation

I'm seeing a large performance regression from switching from wide to fearless_simd in QuState/PhastFT#58 due to overly aggressive inlining. This alone doesn't fix it, but seems like a sensible first step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant