From 9d8be29d94b1c2e9959be76cb4cbfa17f890bfa1 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 24 Sep 2023 13:59:29 -0700 Subject: [PATCH] watchman: use single-threaded async runtime The `#[tokio::main]` annotation uses a multi-threaded runtime by default. We don't need that for querying watchman. Switching to the single-threaded runtime saves about 20 ms. --- lib/src/working_copy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/working_copy.rs b/lib/src/working_copy.rs index c78fa9fdff..780983ac7c 100644 --- a/lib/src/working_copy.rs +++ b/lib/src/working_copy.rs @@ -623,7 +623,7 @@ impl TreeState { } #[cfg(feature = "watchman")] - #[tokio::main] + #[tokio::main(flavor = "current_thread")] #[instrument(skip(self))] pub async fn query_watchman( &self,