Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for wrapping the allocator with tracy #10874

Merged
merged 5 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 110 additions & 17 deletions Cargo.lock

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

10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ bitflags = "2.4"
boyer-moore-magiclen = "0.2.16"
bytes = "1.5"
clap = "4"
cfg-if = "1.0"
const_format = { version = "0.2.32", features = ["rust_1_64"] }
dashmap = "6.0"
derive_more = { version = "1", features = ["full"] }
Expand All @@ -482,7 +483,9 @@ humantime-serde = "1.1"
itertools = "0.13"
linked_hash_set = "0.1"
modular-bitfield = "0.11.2"
notify = { version = "6.1.1", default-features = false, features = ["macos_fsevent"] }
notify = { version = "6.1.1", default-features = false, features = [
"macos_fsevent",
] }
nybbles = "0.2.1"
once_cell = "1.19"
parking_lot = "0.12"
Expand Down Expand Up @@ -576,4 +579,7 @@ serial_test = "3"
similar-asserts = "1.5.0"
tempfile = "3.8"
test-fuzz = "5"
tikv-jemallocator = { version = "0.5.0" }

tikv-jemalloc-ctl = "0.6"
tikv-jemallocator = "0.6"
tracy-client = "0.17.3"
26 changes: 9 additions & 17 deletions bin/reth-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ workspace = true

[dependencies]
# reth
reth-provider = { workspace = true }
reth-cli-runner.workspace = true
reth-db = { workspace = true, features = ["mdbx"] }
reth-cli-util.workspace = true
reth-node-core.workspace = true
reth-node-api.workspace = true
reth-rpc-types.workspace = true
Expand All @@ -25,7 +24,10 @@ reth-primitives = { workspace = true, features = ["alloy-compat"] }
reth-tracing.workspace = true

# alloy
alloy-provider = { workspace = true, features = ["engine-api", "reqwest-rustls-tls"], default-features = false }
alloy-provider = { workspace = true, features = [
"engine-api",
"reqwest-rustls-tls",
], default-features = false }
alloy-rpc-types-engine.workspace = true
alloy-transport.workspace = true
alloy-transport-http.workspace = true
Expand All @@ -34,7 +36,6 @@ alloy-transport-ipc.workspace = true
alloy-pubsub.workspace = true
alloy-json-rpc.workspace = true
alloy-rpc-client.workspace = true
alloy-consensus.workspace = true
alloy-eips.workspace = true

# reqwest
Expand All @@ -50,7 +51,6 @@ tracing.workspace = true

# io
serde.workspace = true
serde_json.workspace = true

# async
tokio = { workspace = true, features = [
Expand All @@ -59,7 +59,6 @@ tokio = { workspace = true, features = [
"time",
"rt-multi-thread",
] }
tokio-util.workspace = true
futures.workspace = true
async-trait.workspace = true

Expand All @@ -71,10 +70,6 @@ clap = { workspace = true, features = ["derive", "env"] }
# for writing data
csv = "1.3.0"

[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { workspace = true, optional = true }
libc = "0.2"

[dev-dependencies]
reth-tracing.workspace = true

Expand All @@ -83,20 +78,17 @@ default = ["jemalloc"]

asm-keccak = ["reth-primitives/asm-keccak"]

jemalloc = ["dep:tikv-jemallocator"]
jemalloc-prof = ["jemalloc", "tikv-jemallocator?/profiling"]
jemalloc = ["reth-cli-util/jemalloc"]
jemalloc-prof = ["reth-cli-util/jemalloc-prof"]
tracy-allocator = ["reth-cli-util/tracy-allocator"]

min-error-logs = ["tracing/release_max_level_error"]
min-warn-logs = ["tracing/release_max_level_warn"]
min-info-logs = ["tracing/release_max_level_info"]
min-debug-logs = ["tracing/release_max_level_debug"]
min-trace-logs = ["tracing/release_max_level_trace"]

optimism = [
"reth-primitives/optimism",
"reth-provider/optimism",
"reth-node-core/optimism",
]
optimism = ["reth-primitives/optimism", "reth-node-core/optimism"]

# no-op feature flag for switching between the `optimism` and default functionality in CI matrices
ethereum = []
Expand Down
12 changes: 9 additions & 3 deletions bin/reth-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
//! This is a tool that converts existing blocks into a stream of blocks for benchmarking purposes.
//! These blocks are then fed into reth as a stream of execution payloads.

// We use jemalloc for performance reasons.
#[cfg(all(feature = "jemalloc", unix))]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

#[global_allocator]
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();

pub mod authenticated_transport;
pub mod bench;
Expand Down
Loading
Loading