From 099c795cca728d49fb4b2c23b42a93008bc5e515 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Sun, 11 Jul 2021 14:22:59 -0400 Subject: [PATCH] Add potential perf gains in the future --- src/cache/disk.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/cache/disk.rs b/src/cache/disk.rs index b085848..6384b03 100644 --- a/src/cache/disk.rs +++ b/src/cache/disk.rs @@ -70,6 +70,24 @@ impl DiskCache { db_update_channel_sender: db_tx, }); + // maybe this is better? in theory this sounds like it should be faster + // but in practice I haven't seen any perf improvements + + // let ret = Arc::clone(&new_self); + // std::thread::spawn(move || { + // tokio::runtime::Builder::new_current_thread() + // .enable_all() + // .build() + // .unwrap() + // .block_on(db_listener( + // Arc::clone(&new_self), + // db_rx, + // db_pool, + // disk_max_size.get() as u64 / 20 * 19, + // )) + // }); + // ret + tokio::spawn(db_listener( Arc::clone(&new_self), db_rx,