perf: inline public getters/setters, and use non-generic inner functions
To reduce compile-times and avoid some overhead to binary size, this will modify some of our generic functions to use non-generic inner functions where possible. The inner functions are marked carefully with `#[inline(never)]` to prevent being inlined by LLVM at their callsites While looking for generic functions to optimize, I have also taken the opportunity to annotate public non-generic getters and setters with `#[inline]` to ensure that LLVM will inline them across crate boundaries. By default, only generic functions are automatically inlined, and only when enabling fat LTO are constant functions reliably inlined across crate boundaries.
This commit is contained in:
parent
c538d672df
commit
8cf372c9b9
55 changed files with 702 additions and 255 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use ashpd::desktop::settings::{ColorScheme, Contrast};
|
||||
use ashpd::desktop::Color;
|
||||
use iced::futures::{self, select, FutureExt, SinkExt, StreamExt};
|
||||
use ashpd::desktop::settings::{ColorScheme, Contrast};
|
||||
use iced::futures::{self, FutureExt, SinkExt, StreamExt, select};
|
||||
use iced_futures::stream;
|
||||
use tracing::error;
|
||||
|
||||
|
|
@ -11,6 +11,7 @@ pub enum Desktop {
|
|||
Contrast(Contrast),
|
||||
}
|
||||
|
||||
#[cold]
|
||||
pub fn desktop_settings() -> iced_futures::Subscription<Desktop> {
|
||||
iced_futures::Subscription::run_with_id(
|
||||
std::any::TypeId::of::<Desktop>(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue