diff --git a/Cargo.lock b/Cargo.lock index 98de17391..96f748a43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4233,6 +4233,7 @@ dependencies = [ "lru", "memory-stats", "miette", + "mimalloc", "pack1", "parking_lot", "paste", diff --git a/core/Cargo.toml b/core/Cargo.toml index ae145386a..fad43c7b1 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -98,6 +98,7 @@ env_logger = "0.11.6" test-log = { version = "0.2.17", features = ["trace"] } lru = "0.14.0" sorted-vec = "0.8.6" +mimalloc = { version = "0.1.46", default-features = false } [[bench]] name = "benchmark" diff --git a/core/benches/benchmark.rs b/core/benches/benchmark.rs index 8ab2e89c4..fda384712 100644 --- a/core/benches/benchmark.rs +++ b/core/benches/benchmark.rs @@ -3,6 +3,10 @@ use pprof::criterion::{Output, PProfProfiler}; use std::{sync::Arc, time::Instant}; use turso_core::{Database, PlatformIO}; +#[cfg(not(target_family = "wasm"))] +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + fn rusqlite_open() -> rusqlite::Connection { let sqlite_conn = rusqlite::Connection::open("../testing/testing.db").unwrap(); sqlite_conn