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

This commit is contained in:
DaniPopes
2024-09-13 18:12:33 +02:00
committed by GitHub
parent 12e8af4a24
commit 87e5e0929f
13 changed files with 204 additions and 73 deletions

View File

@ -18,17 +18,15 @@ reth-node-optimism.workspace = true
clap = { workspace = true, features = ["derive", "env"] }
[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { workspace = true, optional = true }
[lints]
workspace = true
[features]
default = ["jemalloc"]
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"]
asm-keccak = ["reth-optimism-cli/asm-keccak", "reth-node-optimism/asm-keccak"]

View File

@ -10,10 +10,8 @@ use reth_optimism_cli::{chainspec::OpChainSpecParser, Cli};
use reth_optimism_rpc::SequencerClient;
use reth_provider::providers::BlockchainProvider2;
// We use jemalloc for performance reasons
#[cfg(all(feature = "jemalloc", unix))]
#[global_allocator]
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();
fn main() {
reth_cli_util::sigsegv_handler::install();