Skip to content

Commit

Permalink
Add tikv-jemallocator
Browse files Browse the repository at this point in the history
  • Loading branch information
rmqtt committed Jun 15, 2023
1 parent dbc3748 commit e367dbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rmqtt-bench"
version = "0.1.1"
version = "0.1.2"
authors = ["rmqtt <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -12,6 +12,9 @@ description = "rmqtt-bench - MQTT benchmark tool"
name = "rmqtt-bench"
path = "src/main.rs"

[target.'cfg(target_os = "linux")'.dependencies]
tikv-jemallocator = "0.5"

[dependencies]
ntex-mqtt = "0.9"
ntex = { version = "0.5.16", features = ["tokio", "rustls"] }
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ mod script;
mod stats;
mod v3;

#[cfg(target_os = "linux")]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

#[ntex::main]
async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
std::env::set_var("RUST_LOG", "rmqtt_bench=info");
Expand Down

0 comments on commit e367dbe

Please sign in to comment.