Replace easy-parallel with scoped-pool for path searches

The easy-parallel crate spawned new threads on each call, which was resulting in way too many threads.

Co-Authored-By: Brooks Swinnerton <934497+bswinnerton@users.noreply.github.com>
This commit is contained in:
Nathan Sobo
2021-04-14 09:08:52 -06:00
co-authored by Brooks Swinnerton
parent f455355c78
commit 4cef25eff8
7 changed files with 54 additions and 13 deletions
+2 -1
View File
@@ -347,8 +347,9 @@ impl FileFinder {
fn spawn_search(&mut self, query: String, ctx: &mut ViewContext<Self>) {
let worktrees = self.worktrees(ctx.as_ref());
let search_id = util::post_inc(&mut self.search_count);
let pool = ctx.app().scoped_pool().clone();
let task = ctx.background_executor().spawn(async move {
let matches = match_paths(worktrees.as_slice(), &query, false, false, 100);
let matches = match_paths(worktrees.as_slice(), &query, false, false, 100, pool);
(search_id, matches)
});