Skip to content

Commit b3da297

Browse files
Merge #3023
3023: perf: switch global alloc to tikv-jemallocator r=doitian,driftluo a=zhangsoledad <!-- Thank you for contributing to nervosnetwork/ckb! If you haven't already, please read [CONTRIBUTING](https://github.com/nervosnetwork/ckb/blob/develop/CONTRIBUTING.md) document. If you're unsure about anything, just ask; somebody should be along to answer within a day or two. PR Title Format: 1. module [, module2, module3]: what's changed 2. *: what's changed --> ### What problem does this PR solve? gnzlbg/jemallocator#168 jemalloc/jemalloc#1497 see also: rust-lang/rust#83152 ### What is changed and how it works? Proposal: switch global alloc to tikv-jemallocator which is more up-to-date ### Related changes ### Check List <!--REMOVE the items that are not applicable--> Side effects - Performance regression - Breaking backward compatibility ### Release note <!-- Choose from None, Title Only and Note. Bugfixes or new features need a release note. --> ```release-note Title Only: Include only the PR title in the release note. ``` Co-authored-by: zhangsoledad <787953403@qq.com>
2 parents 8383616 + f8a8405 commit b3da297

File tree

4 files changed

+41
-63
lines changed

4 files changed

+41
-63
lines changed

Cargo.lock

Lines changed: 36 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ opt-level = 3
9797
opt-level = 3
9898

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

102102
[features]
103103
default = []
104104
deadlock_detection = ["ckb-bin/deadlock_detection"]
105105
with_sentry = ["ckb-bin/with_sentry"]
106106
with_dns_seeding = ["ckb-bin/with_dns_seeding"]
107-
profiling = ["jemallocator/profiling", "ckb-bin/profiling"]
107+
profiling = ["tikv-jemallocator/profiling", "ckb-bin/profiling"]

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use ckb_build_info::Version;
44

55
#[cfg(all(not(target_env = "msvc"), not(target_os = "macos")))]
66
#[global_allocator]
7-
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
7+
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
88

99
fn main() {
1010
let version = get_version();

util/memory-tracker/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ ckb-db = { path = "../../db", version = "= 0.100.0-pre" }
1616
[target.'cfg(all(not(target_env = "msvc"), not(target_os="macos")))'.dependencies]
1717
heim = { version = "0.0.11", default-features=false, features = ["process"] }
1818
futures = "0.3.1"
19-
jemalloc-ctl = "0.3.3"
20-
jemalloc-sys = "0.3.2"
19+
jemalloc-ctl = { package = "tikv-jemalloc-ctl", version = "0.4.2" }
20+
jemalloc-sys = { package = "tikv-jemalloc-sys", version = "0.4.2" }
2121

2222
[features]
2323
default = []

0 commit comments

Comments
 (0)