-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential to add #[inline} attributes where possible #270
Comments
If you've found a specific case where the lack of |
I benchmarked every function with
I only included results where |
I noticed there is a PR #210 that removed most
#[inline]
annotations. However, in developing one of my crates, I found that Rust's stdlibcbrtf
was a significant bottleneck. I attempted to use this crate, but it provided minimal benefit due to the functions not being inlined. The bottleneck was due to the fact thatcbrtf
was being called in a loop, and could not be autovectorized because it had to be accessed via acall
instruction.If I add the
#[inline]
attribute, my function is able to inline and autovectorize the code, which resulted in a 25% performance improvement. Therefore, I would move to consider readding the#[inline]
attribute where possible. (#[inline(always)]
is not needed, only#[inline]
to allow the compiler to consider it.)Edit: I tried doing the same with
powf
for other places it's used in the crate, and in that case it had a very negative effect... so this turns out to not be a universal thing at all 🤔The text was updated successfully, but these errors were encountered: