From fe4a47d6cc45b0940cf42aef8ea09efce24960f2 Mon Sep 17 00:00:00 2001 From: core Date: Mon, 19 May 2025 10:32:19 -0400 Subject: [PATCH] further optimization --- Cargo.toml | 5 ++++- crates/ar2/src/lib.rs | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cf5897d..a044c5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,4 +10,7 @@ debug = true [profile.dev] opt-level = 1 [profile.dev.package."*"] -opt-level = 3 \ No newline at end of file +opt-level = 3 +[profile.bench] +codegen-units = 1 +lto = "fat" diff --git a/crates/ar2/src/lib.rs b/crates/ar2/src/lib.rs index f768cd9..93ef6ca 100644 --- a/crates/ar2/src/lib.rs +++ b/crates/ar2/src/lib.rs @@ -95,7 +95,7 @@ pub fn parse(input: Vec) -> nexrad_data::result::Result { let mut vcp = None; let mut radials = vec![]; if record.compressed() { - *record = record.decompress()?; + *record = record.decompress()?; // this specifically seems to be most problematic. bzip is SLOW } let messages = record.messages()?; @@ -129,6 +129,7 @@ pub fn parse(input: Vec) -> nexrad_data::result::Result { }) } +#[inline] fn into_radial( message: nexrad_decode::messages::digital_radar_data::Message, ) -> nexrad_data::result::Result { @@ -164,6 +165,7 @@ fn into_radial( }) } +#[inline(always)] fn into_moment_data(block: GenericDataBlock) -> MomentData { MomentData { scale: block.header.scale,