-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Add #[inline]
to almost all of the public API for every crate
#398
Comments
Inlining should be done automatically by the compiler even if it hasn't the "permission" because we have enabled fat lto and have set codegen units to one in #310. It's enabled in the root crate, so it should also affect other crates that live in But I'm not sure of is how that affects potential embedders of the engine. So it might be still needed to mark public functions as |
Yeah that's what I assumed. With "root crate" you mean the binaries? If not, then anywhere the crates are included the configuration of those root crates will count. |
The root crate is The stdlib also uses I generally also think it shouldn't really be a problem when (almost) every function is inlined. Fat lto should from what I have read also do that. @jaytaph What do you think? |
It is a well known "problem" in Rust that automatic cross-crate inlining is not supported. Every function that is seen as good to inline by the programmer has to be annotated with
#[inline]
to basically allow the Rust compiler to do inlining across crate boundaries. If you look into the standard library almost every function is marked as inline, however I haven't really seen that here. Inlining can have a great impact on performance, so we should consider to add#[inline]
to pretty much the entire public API of the crates.This page has a good explanation on how to configure inlining: https://nnethercote.github.io/perf-book/inlining.html
The text was updated successfully, but these errors were encountered: