mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-07 00:00:09 +02:00
This additional benchmark exercises a common request/reply pattern using an MPSC for requests along with a oneshot payload as a reply mechanism. When used in a current threaded scenario, the bench is 17 times faster on my machine than when using the multi-threaded runtime and one worker thread. Not only that, but if I increase the number of worker threads to 6, performance degrades further. Does this suggest a scheduling problem with the multi-threaded runtime? No matter what, hopefully the benchmarks are a useful addition.
65 lines
1.0 KiB
TOML
65 lines
1.0 KiB
TOML
[package]
|
|
name = "benches"
|
|
version = "0.0.0"
|
|
publish = false
|
|
edition = "2018"
|
|
|
|
[dependencies]
|
|
tokio = { version = "1.5.0", path = "../tokio", features = ["full"] }
|
|
bencher = "0.1.5"
|
|
rand = "0.8"
|
|
rand_chacha = "0.3"
|
|
|
|
[dev-dependencies]
|
|
tokio-util = { version = "0.7.0", path = "../tokio-util", features = ["full"] }
|
|
tokio-stream = { path = "../tokio-stream" }
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = "0.2.42"
|
|
|
|
[[bench]]
|
|
name = "spawn"
|
|
path = "spawn.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "sync_mpsc"
|
|
path = "sync_mpsc.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "sync_mpsc_oneshot"
|
|
path = "sync_mpsc_oneshot.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "rt_multi_threaded"
|
|
path = "rt_multi_threaded.rs"
|
|
harness = false
|
|
|
|
|
|
[[bench]]
|
|
name = "sync_rwlock"
|
|
path = "sync_rwlock.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "sync_semaphore"
|
|
path = "sync_semaphore.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "signal"
|
|
path = "signal.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "fs"
|
|
path = "fs.rs"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "copy"
|
|
path = "copy.rs"
|
|
harness = false
|