diff --git a/Cargo.toml b/Cargo.toml index 6b87b3872e1da1..83c7de598e05ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,18 @@ lto = false # Preserve the 'thin local LTO' for this build. split-debuginfo = "unpacked" lto = "thin" +# Enable basic optimizations for dev builds and unittests to trigger const propagation and inlining +[profile.dev] +opt-level = 1 + +# Enable optimizations for procmacros for faster codegen +[profile.dev.build-override] +opt-level = 1 + +# Enable heavier optimizations in deps (we do not rebuild them every time in dev cycle) +[profile.dev.package."*"] +opt-level = 2 + [workspace] members = [ "account-decoder", diff --git a/accounts-db/src/append_vec.rs b/accounts-db/src/append_vec.rs index b9aaa0b9420825..a919745d1148f2 100644 --- a/accounts-db/src/append_vec.rs +++ b/accounts-db/src/append_vec.rs @@ -1277,13 +1277,6 @@ pub mod tests { } } - fn get_executable_byte(&self) -> u8 { - let executable_bool: bool = self.executable(); - // UNSAFE: Force to interpret mmap-backed bool as u8 to really read the actual memory content - let executable_byte: u8 = unsafe { std::mem::transmute::(executable_bool) }; - executable_byte - } - fn set_executable_as_byte(&self, new_executable_byte: u8) { // UNSAFE: Force to interpret mmap-backed &bool as &u8 to write some crafted value; unsafe { @@ -1830,7 +1823,6 @@ pub mod tests { { let executable_bool: bool = account.executable(); assert!(!executable_bool); - assert_eq!(account.get_executable_byte(), 0); // Wow, not crafted_executable! } }) .unwrap(); diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index de52bb097625ab..f9c49aa8203daf 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -3752,6 +3752,7 @@ mod tests { let mut node = cluster_info.my_contact_info.write().unwrap(); node.set_shred_version(42); } + std::thread::sleep(Duration::from_millis(1)); cluster_info.refresh_my_gossip_contact_info(); cluster_info.flush_push_queue(); // Should now include both epoch slots.