diff --git a/Cargo.toml b/Cargo.toml index dd84f93..4dd0cc6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,7 @@ ctrlc = "3.1" humantime = "1.1.1" lscolors = "0.6" globset = "0.4" +jemallocator = "0.3.0" [dependencies.clap] version = "2.31.2" diff --git a/src/main.rs b/src/main.rs index c4af1ef..96964fa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,6 +35,10 @@ use crate::internal::{ pattern_has_uppercase_char, transform_args_with_exec, FileTypes, }; +// We use jemalloc for performance reasons, see https://github.com/sharkdp/fd/pull/480 +#[global_allocator] +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + fn main() { let checked_args = transform_args_with_exec(env::args_os()); let matches = app::build_app().get_matches_from(checked_args);