Baseline benchmarks on my machine
This commit is contained in:
+10
@@ -29,3 +29,13 @@ harness = false
|
|||||||
[[bench]]
|
[[bench]]
|
||||||
name = "multi_scheduler"
|
name = "multi_scheduler"
|
||||||
harness = false
|
harness = false
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "general"
|
||||||
|
harness = false
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "smarm_favored"
|
||||||
|
harness = false
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+102
-140
@@ -2,223 +2,185 @@
|
|||||||
"chained_spawn": {
|
"chained_spawn": {
|
||||||
"smarm 1-thread": {
|
"smarm 1-thread": {
|
||||||
"result": 1000,
|
"result": 1000,
|
||||||
"median": 8637,
|
"median": 9763,
|
||||||
"min": 8553,
|
"min": 8852,
|
||||||
"max": 8933
|
"max": 10520
|
||||||
|
},
|
||||||
|
"smarm 24-thread": {
|
||||||
|
"result": 1000,
|
||||||
|
"median": 23562,
|
||||||
|
"min": 20515,
|
||||||
|
"max": 24398
|
||||||
},
|
},
|
||||||
"tokio current_thread": {
|
"tokio current_thread": {
|
||||||
"result": 1000,
|
"result": 1000,
|
||||||
"median": 124,
|
"median": 70,
|
||||||
"min": 124,
|
"min": 61,
|
||||||
"max": 153
|
"max": 75
|
||||||
},
|
},
|
||||||
"tokio multi-thread": {
|
"tokio multi-thread": {
|
||||||
"result": 1000,
|
"result": 1000,
|
||||||
"median": 188,
|
"median": 187,
|
||||||
"min": 183,
|
"min": 158,
|
||||||
"max": 229
|
"max": 228
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"yield_many": {
|
"yield_many": {
|
||||||
"smarm 1-thread": {
|
"smarm 1-thread": {
|
||||||
"result": 200000,
|
"result": 200000,
|
||||||
"median": 41622,
|
"median": 21704,
|
||||||
"min": 41063,
|
"min": 20353,
|
||||||
"max": 44973
|
"max": 22053
|
||||||
|
},
|
||||||
|
"smarm 24-thread": {
|
||||||
|
"result": 200000,
|
||||||
|
"median": 180752,
|
||||||
|
"min": 148576,
|
||||||
|
"max": 187771
|
||||||
},
|
},
|
||||||
"tokio current_thread": {
|
"tokio current_thread": {
|
||||||
"result": 200000,
|
"result": 200000,
|
||||||
"median": 15085,
|
"median": 5816,
|
||||||
"min": 15013,
|
"min": 5567,
|
||||||
"max": 15274
|
"max": 6278
|
||||||
},
|
},
|
||||||
"tokio multi-thread": {
|
"tokio multi-thread": {
|
||||||
"result": 200000,
|
"result": 200000,
|
||||||
"median": 15964,
|
"median": 8259,
|
||||||
"min": 15880,
|
"min": 7760,
|
||||||
"max": 17959
|
"max": 9610
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fan_out_compute": {
|
"fan_out_compute": {
|
||||||
"smarm 1-thread": {
|
"smarm 1-thread": {
|
||||||
"result": 33860,
|
"result": 33860,
|
||||||
"median": 29727,
|
"median": 14009,
|
||||||
"min": 29491,
|
"min": 13834,
|
||||||
"max": 31634
|
"max": 14274
|
||||||
|
},
|
||||||
|
"smarm 24-thread": {
|
||||||
|
"result": 33860,
|
||||||
|
"median": 2839,
|
||||||
|
"min": 2702,
|
||||||
|
"max": 3019
|
||||||
},
|
},
|
||||||
"tokio current_thread": {
|
"tokio current_thread": {
|
||||||
"result": 33860,
|
"result": 33860,
|
||||||
"median": 28503,
|
"median": 13083,
|
||||||
"min": 28391,
|
"min": 12634,
|
||||||
"max": 28866
|
"max": 15737
|
||||||
},
|
},
|
||||||
"tokio multi-thread": {
|
"tokio multi-thread": {
|
||||||
"result": 33860,
|
"result": 33860,
|
||||||
"median": 34542,
|
"median": 1538,
|
||||||
"min": 34396,
|
"min": 1434,
|
||||||
"max": 36111
|
"max": 2201
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ping_pong_oneshot": {
|
"ping_pong_oneshot": {
|
||||||
"smarm 1-thread": {
|
"smarm 1-thread": {
|
||||||
"result": 1000,
|
"result": 1000,
|
||||||
"median": 16848,
|
"median": 18409,
|
||||||
"min": 16633,
|
"min": 16381,
|
||||||
"max": 17301
|
"max": 21858
|
||||||
|
},
|
||||||
|
"smarm 24-thread": {
|
||||||
|
"result": 1000,
|
||||||
|
"median": 44596,
|
||||||
|
"min": 41804,
|
||||||
|
"max": 48324
|
||||||
},
|
},
|
||||||
"tokio current_thread": {
|
"tokio current_thread": {
|
||||||
"result": 1000,
|
"result": 1000,
|
||||||
"median": 879,
|
"median": 494,
|
||||||
"min": 868,
|
"min": 465,
|
||||||
"max": 973
|
"max": 602
|
||||||
},
|
},
|
||||||
"tokio multi-thread": {
|
"tokio multi-thread": {
|
||||||
"result": 1000,
|
"result": 1000,
|
||||||
"median": 4328,
|
"median": 10907,
|
||||||
"min": 4223,
|
"min": 9582,
|
||||||
"max": 4461
|
"max": 12430
|
||||||
}
|
|
||||||
},
|
|
||||||
"spawn_storm_busy": {
|
|
||||||
"smarm 1-thread": {
|
|
||||||
"result": 10000,
|
|
||||||
"median": 130058,
|
|
||||||
"min": 126790,
|
|
||||||
"max": 134475
|
|
||||||
},
|
|
||||||
"tokio current_thread": {
|
|
||||||
"result": 10000,
|
|
||||||
"median": 2772,
|
|
||||||
"min": 2641,
|
|
||||||
"max": 4367
|
|
||||||
},
|
|
||||||
"tokio multi-thread": {
|
|
||||||
"result": 10000,
|
|
||||||
"median": 7462,
|
|
||||||
"min": 4469,
|
|
||||||
"max": 12892
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mpsc_contention": {
|
|
||||||
"smarm 1-thread": {
|
|
||||||
"result": 320000,
|
|
||||||
"median": 9260,
|
|
||||||
"min": 9095,
|
|
||||||
"max": 10081
|
|
||||||
},
|
|
||||||
"tokio current_thread": {
|
|
||||||
"result": 320000,
|
|
||||||
"median": 17570,
|
|
||||||
"min": 17213,
|
|
||||||
"max": 18276
|
|
||||||
},
|
|
||||||
"tokio multi-thread": {
|
|
||||||
"result": 320000,
|
|
||||||
"median": 17593,
|
|
||||||
"min": 17452,
|
|
||||||
"max": 19564
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"many_timers": {
|
|
||||||
"smarm 1-thread": {
|
|
||||||
"result": 10000,
|
|
||||||
"median": 135806,
|
|
||||||
"min": 132573,
|
|
||||||
"max": 141651
|
|
||||||
},
|
|
||||||
"tokio current_thread": {
|
|
||||||
"result": 10000,
|
|
||||||
"median": 14462,
|
|
||||||
"min": 13555,
|
|
||||||
"max": 15457
|
|
||||||
},
|
|
||||||
"tokio multi-thread": {
|
|
||||||
"result": 10000,
|
|
||||||
"median": 15011,
|
|
||||||
"min": 14655,
|
|
||||||
"max": 15368
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"multi_thread_scaling": {
|
|
||||||
"smarm 1-thread": {
|
|
||||||
"result": 33860,
|
|
||||||
"median": 30029,
|
|
||||||
"min": 29720,
|
|
||||||
"max": 31351
|
|
||||||
},
|
|
||||||
"tokio multi 1-thread": {
|
|
||||||
"result": 33860,
|
|
||||||
"median": 28983,
|
|
||||||
"min": 28908,
|
|
||||||
"max": 29323
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deep_recursion": {
|
"deep_recursion": {
|
||||||
"smarm 1-thread": {
|
"smarm 1-thread": {
|
||||||
"result": 1,
|
"result": 1,
|
||||||
"median": 83,
|
"median": 123,
|
||||||
"min": 78,
|
"min": 108,
|
||||||
"max": 587
|
"max": 169
|
||||||
|
},
|
||||||
|
"smarm 24-thread": {
|
||||||
|
"result": 1,
|
||||||
|
"median": 633,
|
||||||
|
"min": 558,
|
||||||
|
"max": 783
|
||||||
},
|
},
|
||||||
"tokio current_thread": {
|
"tokio current_thread": {
|
||||||
"result": 1,
|
"result": 1,
|
||||||
"median": 25,
|
"median": 12,
|
||||||
"min": 25,
|
"min": 11,
|
||||||
"max": 33
|
"max": 14
|
||||||
},
|
},
|
||||||
"tokio multi-thread": {
|
"tokio multi-thread": {
|
||||||
"result": 1,
|
"result": 1,
|
||||||
"median": 59,
|
"median": 52,
|
||||||
"min": 47,
|
"min": 42,
|
||||||
"max": 205
|
"max": 55
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"yield_in_hot_loop": {
|
"yield_in_hot_loop": {
|
||||||
"smarm 1-thread": {
|
"smarm 1-thread": {
|
||||||
"result": 1000000,
|
"result": 1000000,
|
||||||
"median": 188753,
|
"median": 82273,
|
||||||
"min": 187007,
|
"min": 81870,
|
||||||
"max": 194366
|
"max": 86041
|
||||||
},
|
},
|
||||||
"tokio current_thread": {
|
"tokio current_thread": {
|
||||||
"result": 1000000,
|
"result": 1000000,
|
||||||
"median": 153929,
|
"median": 75353,
|
||||||
"min": 152712,
|
"min": 71841,
|
||||||
"max": 158749
|
"max": 77573
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"uncontended_channel": {
|
"uncontended_channel": {
|
||||||
"smarm 1-thread": {
|
"smarm 1-thread": {
|
||||||
"result": 1000000,
|
"result": 1000000,
|
||||||
"median": 26811,
|
"median": 9390,
|
||||||
"min": 26498,
|
"min": 9331,
|
||||||
"max": 29069
|
"max": 12504
|
||||||
},
|
},
|
||||||
"tokio current_thread": {
|
"tokio current_thread": {
|
||||||
"result": 1000000,
|
"result": 1000000,
|
||||||
"median": 51888,
|
"median": 17007,
|
||||||
"min": 51530,
|
"min": 16933,
|
||||||
"max": 52708
|
"max": 17657
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"catch_unwind_panics": {
|
"catch_unwind_panics": {
|
||||||
"smarm 1-thread": {
|
"smarm 1-thread": {
|
||||||
"result": 10000,
|
"result": 10000,
|
||||||
"median": 142215,
|
"median": 144807,
|
||||||
"min": 140189,
|
"min": 138473,
|
||||||
"max": 143570
|
"max": 153664
|
||||||
|
},
|
||||||
|
"smarm 24-thread": {
|
||||||
|
"result": 10000,
|
||||||
|
"median": 267812,
|
||||||
|
"min": 229587,
|
||||||
|
"max": 288329
|
||||||
},
|
},
|
||||||
"tokio current_thread": {
|
"tokio current_thread": {
|
||||||
"result": 10000,
|
"result": 10000,
|
||||||
"median": 682295,
|
"median": 11084,
|
||||||
"min": 670281,
|
"min": 10904,
|
||||||
"max": 700774
|
"max": 12041
|
||||||
},
|
},
|
||||||
"tokio multi-thread": {
|
"tokio multi-thread": {
|
||||||
"result": 10000,
|
"result": 10000,
|
||||||
"median": 662688,
|
"median": 6029,
|
||||||
"min": 641453,
|
"min": 5054,
|
||||||
"max": 681868
|
"max": 7216
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -272,6 +272,8 @@ fn bench_panic_smarm(threads: usize) -> (u64, u128) {
|
|||||||
let err = Arc::new(AtomicU64::new(0));
|
let err = Arc::new(AtomicU64::new(0));
|
||||||
let ok2 = ok.clone();
|
let ok2 = ok.clone();
|
||||||
let err2 = err.clone();
|
let err2 = err.clone();
|
||||||
|
let prev_hook = std::panic::take_hook();
|
||||||
|
std::panic::set_hook(Box::new(|_| {}));
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
smarm::runtime::init(bench_cfg(threads)).run(move || {
|
smarm::runtime::init(bench_cfg(threads)).run(move || {
|
||||||
let mut handles = Vec::new();
|
let mut handles = Vec::new();
|
||||||
@@ -289,6 +291,7 @@ fn bench_panic_smarm(threads: usize) -> (u64, u128) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
std::panic::set_hook(prev_hook);
|
||||||
let total = ok.load(Ordering::Relaxed) + err.load(Ordering::Relaxed);
|
let total = ok.load(Ordering::Relaxed) + err.load(Ordering::Relaxed);
|
||||||
(total, start.elapsed().as_micros())
|
(total, start.elapsed().as_micros())
|
||||||
}
|
}
|
||||||
@@ -299,6 +302,8 @@ fn bench_panic_tokio_current() -> (u64, u128) {
|
|||||||
let ok2 = ok.clone();
|
let ok2 = ok.clone();
|
||||||
let err2 = err.clone();
|
let err2 = err.clone();
|
||||||
let rt = tokio::runtime::Builder::new_current_thread().build().unwrap();
|
let rt = tokio::runtime::Builder::new_current_thread().build().unwrap();
|
||||||
|
let prev_hook = std::panic::take_hook();
|
||||||
|
std::panic::set_hook(Box::new(|_| {}));
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
let local = tokio::task::LocalSet::new();
|
let local = tokio::task::LocalSet::new();
|
||||||
local.block_on(&rt, async move {
|
local.block_on(&rt, async move {
|
||||||
@@ -317,6 +322,7 @@ fn bench_panic_tokio_current() -> (u64, u128) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
std::panic::set_hook(prev_hook);
|
||||||
let total = ok.load(Ordering::Relaxed) + err.load(Ordering::Relaxed);
|
let total = ok.load(Ordering::Relaxed) + err.load(Ordering::Relaxed);
|
||||||
(total, start.elapsed().as_micros())
|
(total, start.elapsed().as_micros())
|
||||||
}
|
}
|
||||||
@@ -330,6 +336,8 @@ fn bench_panic_tokio_multi() -> (u64, u128) {
|
|||||||
.worker_threads(available_threads())
|
.worker_threads(available_threads())
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
let prev_hook = std::panic::take_hook();
|
||||||
|
std::panic::set_hook(Box::new(|_| {}));
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
rt.block_on(async move {
|
rt.block_on(async move {
|
||||||
let mut handles = Vec::new();
|
let mut handles = Vec::new();
|
||||||
@@ -347,6 +355,7 @@ fn bench_panic_tokio_multi() -> (u64, u128) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
std::panic::set_hook(prev_hook);
|
||||||
let total = ok.load(Ordering::Relaxed) + err.load(Ordering::Relaxed);
|
let total = ok.load(Ordering::Relaxed) + err.load(Ordering::Relaxed);
|
||||||
(total, start.elapsed().as_micros())
|
(total, start.elapsed().as_micros())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user