Merge 'core/storage: Micro-optimize Pager::commit_dirty_pages()' from Pekka Enberg

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.

Reviewed-by: Pere Diaz Bou <pere-altea@homail.com>

Closes #2808
This commit is contained in:
Pekka Enberg
2025-08-27 13:26:22 +03:00
committed by GitHub

View File

@@ -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()