Skip to content

Commit

Permalink
Use jemalloc.
Browse files Browse the repository at this point in the history
  • Loading branch information
grao1991 committed Apr 18, 2024
1 parent ead469a commit 635de3f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
21 changes: 21 additions & 0 deletions rust/Cargo.lock

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

4 changes: 4 additions & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ google-cloud-googleapis = "0.10.0"
google-cloud-pubsub = "0.18.0"
hex = "0.4.3"
itertools = "0.12.1"
jemallocator = { version = "0.5.0", features = [
"profiling",
"unprefixed_malloc_on_supported_platforms",
] }
kanal = { version = "0.1.0-pre8", features = ["async"] }
once_cell = "1.10.0"
num_cpus = "1.16.0"
Expand Down
3 changes: 3 additions & 0 deletions rust/processor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ native-tls = { workspace = true }
postgres-native-tls = { workspace = true }
tokio-postgres = { workspace = true }

[target.'cfg(unix)'.dependencies]
jemallocator = { workspace = true }

[features]
libpq = ["diesel/postgres"]
# When using the default features we enable the diesel/postgres feature. We configure
Expand Down
4 changes: 4 additions & 0 deletions rust/processor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ use clap::Parser;
use processor::IndexerGrpcProcessorConfig;
use server_framework::ServerArgs;

#[cfg(unix)]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

const RUNTIME_WORKER_MULTIPLIER: usize = 2;

fn main() -> Result<()> {
Expand Down

0 comments on commit 635de3f

Please sign in to comment.