From ae42762a6d94e702e0e81e5181f11f33fca6c0eb Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Mon, 13 Jun 2022 02:02:01 +0100 Subject: [PATCH] Fix mimalloc perf regression in 57a4b6d6ce9fb It looks like we were allocating large buffers for wu-diff, and mimalloc performance is much worse for this case in the new version. This reverts performance back to that 0.28 for large files, such as the example in #297. --- Cargo.lock | 9 +++++---- Cargo.toml | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 360189c3b..d6c774691 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -195,6 +195,7 @@ dependencies = [ "itertools", "lazy_static", "libc", + "libmimalloc-sys", "log", "mimalloc", "owo-colors", @@ -302,9 +303,9 @@ checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "libmimalloc-sys" -version = "0.1.25" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ca136052550448f55df7898c6dbe651c6b574fe38a0d9ea687a9f8088a2e2c" +checksum = "7705fc40f6ed493f73584abbb324e74f96b358ff60dfe5659a0f8fc12c590a69" dependencies = [ "cc", ] @@ -335,9 +336,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.29" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f64ad83c969af2e732e907564deb0d0ed393cec4af80776f77dd77a1a427698" +checksum = "b0dfa131390c2f6bdb3242f65ff271fcdaca5ff7b6c08f28398be7f2280e3926" dependencies = [ "libmimalloc-sys", ] diff --git a/Cargo.toml b/Cargo.toml index 40bbcbd7a..396100ea4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,9 @@ libc = "0.2.108" log = "0.4.14" pretty_env_logger = "0.4.0" mimalloc = { version = "0.1.28", default-features = false } +# Pin libmimalloc-sys due to 0.1.25 producing a huge slowdown in very +# large textual files, as discussed in #297. +libmimalloc-sys = "=0.1.24" radix-heap = "0.4.2" walkdir = "2.3.2" term_size = "0.3.2"