mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-29 05:54:21 +01:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user