[package]
name = "bench"
version = "0.1.0"
edition = "2021"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = ["parking_lot"]
# These feature flags can be disabled if we don't want to run comparison
# benchmarks, such as when just comparing two `thingbuf` versions.
comparisons = ["crossbeam", "async-std", "futures", "tokio-sync", "std-sync"]
tokio-sync = ["tokio/sync"]
std-sync = []

# Use parking_lot mutexes in `thingbuf` 
parking_lot = ["thingbuf/parking_lot"]

[dependencies]
thingbuf = { path = ".." }
criterion = { version = "0.3.5", features = ["async_tokio"] }

# for comparison benchmarks
tokio = { version = "1.14.0", features = ["rt", "rt-multi-thread", "sync", "parking_lot"] }
crossbeam = { version = "0.8.1", optional = true }
async-std = { version = "1", optional = true }
futures = { version = "0.3", optional = true }

[[bench]]
name = "sync_spsc"
harness = false

[[bench]]
name = "async_mpsc"
harness = false

[[bench]]
name = "async_spsc"
harness = false