Skip to content

Commit

Permalink
fix(perf): switch global allocator to jemalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
x-hgg-x committed Oct 22, 2024
1 parent 42f4143 commit adab712
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ snapbox = { version = "0.6.18", features = ["diff", "dir", "term-svg", "regex",
tar = { version = "0.4.42", default-features = false }
tempfile = "3.10.1"
thiserror = "1.0.63"
tikv-jemallocator = "0.6"
time = { version = "0.3.36", features = ["parsing", "formatting", "serde"] }
toml = "0.8.19"
toml_edit = { version = "0.22.20", features = ["serde"] }
Expand Down Expand Up @@ -243,6 +244,9 @@ features = [
"Win32_System_Threading",
]

[target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemallocator.workspace = true

[dev-dependencies]
annotate-snippets = { workspace = true, features = ["testing-colors"] }
cargo-test-support.workspace = true
Expand Down
4 changes: 4 additions & 0 deletions src/bin/cargo/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#![allow(clippy::self_named_module_files)] // false positive in `commands/build.rs`

#[cfg(not(target_env = "msvc"))]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

use cargo::core::features;
use cargo::core::shell::Shell;
use cargo::util::network::http::http_handle;
Expand Down

0 comments on commit adab712

Please sign in to comment.