From faa4e4ef05c4f7cacb6767572af3403f2ddb4667 Mon Sep 17 00:00:00 2001 From: Лач Date: Sun, 28 Jun 2020 20:37:07 +0000 Subject: [PATCH] perf: use mimalloc instead of jemalloc --- --- a/Cargo.lock +++ b/Cargo.lock @@ -36,9 +36,9 @@ [[package]] name = "cc" -version = "1.0.54" +version = "1.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" +checksum = "b1be3409f94d7bdceeb5f5fac551039d9b3f00e25da7a74fc4d33400a0d96368" [[package]] name = "clap" @@ -76,12 +76,6 @@ checksum = "d6173fd61b610d15a7566dd7b7620775627441c4ab9dac8906e17cb93a24b782" [[package]] -name = "fs_extra" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674" - -[[package]] name = "heck" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -97,27 +91,6 @@ checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe" dependencies = [ "autocfg", -] - -[[package]] -name = "jemalloc-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45" -dependencies = [ - "cc", - "fs_extra", - "libc", -] - -[[package]] -name = "jemallocator" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69" -dependencies = [ - "jemalloc-sys", - "libc", ] [[package]] @@ -126,9 +99,9 @@ dependencies = [ "annotate-snippets", "clap", - "jemallocator", "jrsonnet-evaluator", "jrsonnet-parser", + "mimallocator", ] [[package]] @@ -189,6 +162,25 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] +name = "mimalloc-sys" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aa3cefb626f6ae3d0b2f71c5378c89d2b1d4d7bc246b0ca9a7ee61a4daad291" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "mimallocator" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d44fe4ebf6b538fcf39d9975c2b90bb3232d1ba8e8bffeacd004f27b20c577a" +dependencies = [ + "mimalloc-sys", +] + +[[package]] name = "os_str_bytes" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" --- a/cmds/jrsonnet/Cargo.toml +++ b/cmds/jrsonnet/Cargo.toml @@ -12,7 +12,8 @@ jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "1.0.0" } jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "1.0.0" } annotate-snippets = "0.8.0" -jemallocator = "0.3.2" +# TODO: Fix mimalloc compile errors, and use them +mimallocator = "0.1.3" [dependencies.clap] version = "3.0.0-beta.1" --- a/cmds/jrsonnet/src/main.rs +++ b/cmds/jrsonnet/src/main.rs @@ -8,7 +8,7 @@ use std::{collections::HashMap, path::PathBuf, rc::Rc, str::FromStr}; #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static GLOBAL: mimallocator::Mimalloc = mimallocator::Mimalloc; enum Format { None, -- gitstuff