From 2921033b281ef0560c60da0644d24df0a3d723d8 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Wed, 27 Aug 2025 11:11:45 +0300 Subject: [PATCH] core/storage: Micro-optimize Pager::commit_dirty_pages() There's no need to call io.now() unless debug tracing is on. Let's micro-optimize commit_dirty_pages() to avoid the unnecessary call. --- core/storage/pager.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/storage/pager.rs b/core/storage/pager.rs index fcee1ec4c..1e6341fd5 100644 --- a/core/storage/pager.rs +++ b/core/storage/pager.rs @@ -1435,11 +1435,11 @@ impl Pager { } } }; - - let now = self.io.now(); tracing::debug!( "total time flushing cache: {} ms", - now.to_system_time() + self.io + .now() + .to_system_time() .duration_since(self.commit_info.time.get().to_system_time()) .unwrap() .as_millis()