From bf9c3c2b5adbf30996b6225badf09b4234c2d7fc Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 11 Apr 2023 13:01:16 +0200 Subject: [PATCH] perf: speed up the happy path for MapRead::get_speculative Signed-off-by: ljedrz --- synthesizer/src/store/helpers/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/synthesizer/src/store/helpers/mod.rs b/synthesizer/src/store/helpers/mod.rs index 2042a9ca17..da86cc6d95 100644 --- a/synthesizer/src/store/helpers/mod.rs +++ b/synthesizer/src/store/helpers/mod.rs @@ -111,9 +111,6 @@ pub trait MapRead< K: Borrow, Q: PartialEq + Eq + Hash + Serialize + ?Sized, { - // Return early in case of errors in order to not conceal them. - let map_value = self.get(key)?; - // Retrieve the atomic batch value, if it exists. let atomic_batch_value = self.get_batched(key); @@ -121,7 +118,7 @@ pub trait MapRead< match atomic_batch_value { Some(Some(value)) => Ok(Some(Cow::Owned(value))), Some(None) => Ok(None), - None => Ok(map_value), + None => self.get(key), } }