Skip to content

Commit 7399928

Browse files
Use jemalloc
1 parent 336113f commit 7399928

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

Cargo.lock

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

ext/hyper_ruby/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ rb-sys = "0.9.110"
1919
hyper = { version = "1.0", features = ["http1", "http2", "server"] }
2020
hyper-util = { version = "0.1", features = ["tokio", "server", "http1", "http2"] }
2121
http-body-util = "0.1.2"
22+
jemallocator = { version = "0.5.4", features = ["disable_initial_exec_tls"] }
23+
24+
[profile.release]
25+
lto = "fat"
26+
codegen-units = 1
27+
panic = "abort"
28+
strip = true
29+
opt-level = 3

ext/hyper_ruby/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ use hyper_util::server::conn::auto;
3131
use http_body_util::BodyExt; // You'll need this
3232
use http_body_util::Full;
3333

34+
use jemallocator::Jemalloc;
35+
36+
#[global_allocator]
37+
static GLOBAL: Jemalloc = Jemalloc;
38+
3439
#[derive(Clone)]
3540
struct ServerConfig {
3641
bind_address: String,

0 commit comments

Comments
 (0)