Skip to content

Commit

Permalink
Merge #3023
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bors[bot] and zhangsoledad authored Sep 9, 2021
2 parents 8383616 + f8a8405 commit b3da297
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 b3da297

Please sign in to comment.