Skip to content

Commit

Permalink
perf: switch global alloc to tikv-jemallocator
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangsoledad committed Sep 8, 2021
1 parent 8383616 commit f8a8405
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 63 deletions.
94 changes: 36 additions & 58 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ opt-level = 3
opt-level = 3

[target.'cfg(all(not(target_env = "msvc"), not(target_os="macos")))'.dependencies]
jemallocator = { version = "0.3.0", features = ["unprefixed_malloc_on_supported_platforms"] }
tikv-jemallocator = { version = "0.4.0", features = ["unprefixed_malloc_on_supported_platforms"] }

[features]
default = []
deadlock_detection = ["ckb-bin/deadlock_detection"]
with_sentry = ["ckb-bin/with_sentry"]
with_dns_seeding = ["ckb-bin/with_dns_seeding"]
profiling = ["jemallocator/profiling", "ckb-bin/profiling"]
profiling = ["tikv-jemallocator/profiling", "ckb-bin/profiling"]
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use ckb_build_info::Version;

#[cfg(all(not(target_env = "msvc"), not(target_os = "macos")))]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

fn main() {
let version = get_version();
Expand Down
4 changes: 2 additions & 2 deletions util/memory-tracker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ ckb-db = { path = "../../db", version = "= 0.100.0-pre" }
[target.'cfg(all(not(target_env = "msvc"), not(target_os="macos")))'.dependencies]
heim = { version = "0.0.11", default-features=false, features = ["process"] }
futures = "0.3.1"
jemalloc-ctl = "0.3.3"
jemalloc-sys = "0.3.2"
jemalloc-ctl = { package = "tikv-jemalloc-ctl", version = "0.4.2" }
jemalloc-sys = { package = "tikv-jemalloc-sys", version = "0.4.2" }

[features]
default = []
Expand Down

0 comments on commit f8a8405

Please sign in to comment.