Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 06aec1e

Browse files
tonyalaribemrcnskibkchr
authored
Introduce jemalloc-allocator feature flag (#6675)
* Introduce jemalloc-stats feature flag * remove unneeded space * Update node/overseer/src/lib.rs Co-authored-by: Marcin S. <[email protected]> * Update Cargo.toml Co-authored-by: Marcin S. <[email protected]> * revert making tikv-jemallocator depend on jemalloc-stats * conditionally import memory_stats instead of using dead_code * fix test via expllicit import * Add jemalloc-stats feature to crates, propagate it from root * Apply `jemalloc-stats` feature to prepare mem stats; small refactor * effect changes recommended on PR * Update node/overseer/src/metrics.rs Co-authored-by: Marcin S. <[email protected]> * fix compile error on in pipeline for linux. missing import * Update node/overseer/src/lib.rs Co-authored-by: Bastian Köcher <[email protected]> * revert to defining collect_memory_stats inline --------- Co-authored-by: Marcin S. <[email protected]> Co-authored-by: Marcin S <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
1 parent 19f6665 commit 06aec1e

File tree

10 files changed

+212
-178
lines changed

10 files changed

+212
-178
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ repository = "https://github.com/paritytech/polkadot.git"
1919
version = "0.9.37"
2020

2121
[dependencies]
22-
polkadot-cli = { path = "cli", features = [ "kusama-native", "westend-native", "rococo-native", "hostperfcheck" ] }
2322
color-eyre = { version = "0.6.1", default-features = false }
2423
tikv-jemallocator = "0.5.0"
2524

25+
# Crates in our workspace, defined as dependencies so we can pass them feature flags.
26+
polkadot-cli = { path = "cli", features = [ "kusama-native", "westend-native", "rococo-native" ] }
27+
polkadot-node-core-pvf = { path = "node/core/pvf" }
28+
polkadot-overseer = { path = "node/overseer" }
29+
2630
[dev-dependencies]
2731
assert_cmd = "2.0.4"
2832
nix = { version = "0.26.1", features = ["signal"] }
@@ -202,6 +206,7 @@ try-runtime = [ "polkadot-cli/try-runtime" ]
202206
fast-runtime = [ "polkadot-cli/fast-runtime" ]
203207
runtime-metrics = [ "polkadot-cli/runtime-metrics" ]
204208
pyroscope = ["polkadot-cli/pyroscope"]
209+
jemalloc-allocator = ["polkadot-node-core-pvf/jemalloc-allocator", "polkadot-overseer/jemalloc-allocator"]
205210

206211
# Configuration for building a .deb package - for use with `cargo-deb`
207212
[package.metadata.deb]

node/core/pvf/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ rand = "0.8.5"
2020
rayon = "1.5.1"
2121
slotmap = "1.0"
2222
tempfile = "3.3.0"
23-
tikv-jemalloc-ctl = "0.5.0"
23+
tikv-jemalloc-ctl = { version = "0.5.0", optional = true }
2424
tokio = { version = "1.24.2", features = ["fs", "process"] }
2525

2626
parity-scale-codec = { version = "3.3.0", default-features = false, features = ["derive"] }
@@ -41,9 +41,13 @@ sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master
4141

4242
[target.'cfg(target_os = "linux")'.dependencies]
4343
libc = "0.2.139"
44+
tikv-jemalloc-ctl = "0.5.0"
4445

4546
[dev-dependencies]
4647
adder = { package = "test-parachain-adder", path = "../../../parachain/test-parachains/adder" }
4748
halt = { package = "test-parachain-halt", path = "../../../parachain/test-parachains/halt" }
4849
hex-literal = "0.3.4"
4950
tempfile = "3.3.0"
51+
52+
[features]
53+
jemalloc-allocator = ["dep:tikv-jemalloc-ctl"]

0 commit comments

Comments
 (0)