From e9e3fac59dc3ce6d6368b0e1a4a1af6d90fc0c4c Mon Sep 17 00:00:00 2001 From: Darren Schroeder Date: Thu, 30 Apr 2020 13:43:59 -0500 Subject: [PATCH] Remove bin.is_file() because it's expensive (#1689) This one change takes the startup time from 2.8 seconds to 1.2 seconds in my testing on Windows. --- crates/nu-cli/src/cli.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/crates/nu-cli/src/cli.rs b/crates/nu-cli/src/cli.rs index c4862d5a00..05d312b103 100644 --- a/crates/nu-cli/src/cli.rs +++ b/crates/nu-cli/src/cli.rs @@ -136,10 +136,6 @@ pub fn load_plugins(context: &mut Context) -> Result<(), ShellError> { Err(_) => {} Ok(binaries) => { for bin in binaries.filter_map(Result::ok) { - if !bin.is_file() { - continue; - } - let bin_name = { if let Some(name) = bin.file_name() { match name.to_str() {