Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions benchmarks/criterion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ harness = false
[dependencies]
criterion = "0.3.0"
sled = { path = "../.." }

[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies]
jemallocator = "0.3.2"
12 changes: 4 additions & 8 deletions benchmarks/criterion/benches/sled.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
use criterion::{criterion_group, criterion_main, Criterion};

use jemallocator::Jemalloc;

use sled::Config;

#[cfg_attr(
// only enable jemalloc on linux and macos by default
any(target_os = "linux", target_os = "macos"),
global_allocator
)]
static ALLOC: Jemalloc = Jemalloc;
// only enable jemalloc on linux and macos by default
#[cfg(any(target_os = "linux", target_os = "macos"))]
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

fn counter() -> usize {
use std::sync::atomic::{AtomicUsize, Ordering::Relaxed};
Expand Down