diff --git a/.cargo/config.toml b/.cargo/config.toml index d9c635df5dc7..4e96bd6b58c0 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -23,3 +23,7 @@ split-debuginfo = "unpacked" rustflags = ["--remap-path-prefix", "=clippy_dev"] [profile.dev.package.lintcheck] rustflags = ["--remap-path-prefix", "=lintcheck"] + +# Configure malloc for faster compiling Clippy itself +[env] +MALLOC_CONF = "percpu_arena:phycpu,metadata_thp:always,dirty_decay_ms:300,muzzy_decay_ms:300" diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index ba80e122448d..a771cbe14276 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -579,6 +579,10 @@ fn register_categories(store: &mut rustc_lint::LintStore) { /// Used in `./src/driver.rs`. #[expect(clippy::too_many_lines)] pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) { + // Avoid unnecessary reallocations + store.late_passes.reserve(320); + store.early_passes.reserve(64); + register_categories(store); for (old_name, new_name) in deprecated_lints::RENAMED {