Cpu perf (#2596)
* break when there's nothing to read Signed-off-by: Wang, Yi A <yi.a.wang@intel.com> * Different approach, only listen on stdin when `LOG_LEVEL=debug` (which is where dropping to a debugger is important). --------- Signed-off-by: Wang, Yi A <yi.a.wang@intel.com> Co-authored-by: Wang, Yi A <yi.a.wang@intel.com>
This commit is contained in:
parent
ce28ee88d5
commit
3ea82d008c
|
@ -944,6 +944,7 @@ fn shard_manager(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// We read stdin in another thread as it seems that lines() can block in some cases
|
// We read stdin in another thread as it seems that lines() can block in some cases
|
||||||
|
if LevelFilter::current() >= tracing::Level::DEBUG {
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
let mut stdin = io::stdin(); // We get `Stdin` here.
|
let mut stdin = io::stdin(); // We get `Stdin` here.
|
||||||
loop {
|
loop {
|
||||||
|
@ -955,6 +956,7 @@ fn shard_manager(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let mut ready = false;
|
let mut ready = false;
|
||||||
let start_time = Instant::now();
|
let start_time = Instant::now();
|
||||||
|
|
Loading…
Reference in New Issue