Skip to content

Commit

Permalink
Use Mimalloc (#572)
Browse files Browse the repository at this point in the history
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

We've had excellent results with this elsewhere, let's try it here.

### How

Import mimalloc, set global allocator.
  • Loading branch information
danieljharvey committed Aug 13, 2024
1 parent bf4bb44 commit df41f11
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ hyper = "0.14"
indexmap = "2"
insta = "1"
jsonschema = "0.17"
mimalloc = "0.1"
multimap = "0.9"
nonempty = "0.10"
percent-encoding = "2"
Expand Down
1 change: 1 addition & 0 deletions crates/connectors/ndc-postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ query-engine-translation = { path = "../../query-engine/translation" }
ndc-sdk = { workspace = true }

async-trait = { workspace = true }
mimalloc = { workspace = true }
percent-encoding = { workspace = true }
prometheus = { workspace = true }
serde_json = { workspace = true, features = ["raw_value"] }
Expand Down
3 changes: 3 additions & 0 deletions crates/connectors/ndc-postgres/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use ndc_postgres::connector::PostgresSetup;
use ndc_postgres_configuration::environment::ProcessEnvironment;
use ndc_sdk::default_main::default_main_with;

#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

#[tokio::main]
pub async fn main() -> ExitCode {
let result = default_main_with(PostgresSetup::new(ProcessEnvironment)).await;
Expand Down

0 comments on commit df41f11

Please sign in to comment.