blocking: opt-out CPUs auto-detection in debug mode (#807)

This tweaks the tokio runtime checker (only used in debug mode) in
order to use a single thread.
Performing the CPUs auto-detection step on each check adds significant
syscall-tracing noise and runtime latency. This completely skips it.
This commit is contained in:
Luca Bruno
2020-02-17 19:05:22 +01:00
committed by GitHub
parent f6ff7f4364
commit 7622c75064

View File

@@ -68,6 +68,7 @@ fn enter() {
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
{ {
tokio::runtime::Builder::new() tokio::runtime::Builder::new()
.core_threads(1)
.build() .build()
.expect("build shell runtime") .expect("build shell runtime")
.enter(|| {}); .enter(|| {});