diff --git a/Cargo.toml b/Cargo.toml index 91a7f94c..9a646b43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,9 @@ bench = false name = "tket2" path = "src/lib.rs" +[profile.release] +lto = "thin" + [dependencies] lazy_static = "1.4.0" cgmath = "0.18.0" diff --git a/taso-optimiser/Cargo.toml b/taso-optimiser/Cargo.toml index d3106737..5d82ccb7 100644 --- a/taso-optimiser/Cargo.toml +++ b/taso-optimiser/Cargo.toml @@ -17,6 +17,9 @@ tracing-subscriber = "0.3.17" tracing-appender = "0.2.2" peak_alloc = { version = "0.2.0", optional = true } +[target.'cfg(not(target_env = "msvc"))'.dependencies] +tikv-jemallocator = "0.5" + [features] -default = ["peak_alloc"] +default = [] peak_alloc = ["dep:peak_alloc"] diff --git a/taso-optimiser/src/main.rs b/taso-optimiser/src/main.rs index 9ca1242a..be58c97a 100644 --- a/taso-optimiser/src/main.rs +++ b/taso-optimiser/src/main.rs @@ -15,11 +15,12 @@ use tket2::optimiser::taso::log::TasoLogger; use tket2::optimiser::TasoOptimiser; #[cfg(feature = "peak_alloc")] -use peak_alloc::PeakAlloc; +#[global_allocator] +static PEAK_ALLOC: peak_alloc::PeakAlloc = peak_alloc::PeakAlloc; -#[cfg(feature = "peak_alloc")] +#[cfg(all(not(target_env = "msvc"), not(feature = "peak_alloc")))] #[global_allocator] -static PEAK_ALLOC: PeakAlloc = PeakAlloc; +static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; /// Optimise circuits using Quartz-generated ECCs. ///