Open jon-chuang opened 2 years ago
@ihciah @dyxushuai does monoio work with {futures::channel, tokio::sync}::oneshot::channel
?
I am getting this error with https://github.com/tikv/minitrace-rust/issues/94
FYI, a minimal reproducible example:
#[monoio::test]
async fn block_forever() {
let (tx, rx) = futures::channel::oneshot::channel();
std::thread::spawn(move || {
tx.send(()).unwrap();
});
rx.await.unwrap();
}
Thanks! We will investigate it. @dyxushuai
tokio tracing is slow as requires
Sync
and uses slow primitives Can take inspiration from https://github.com/tikv/minitrace-rust And optimize further for thread-per-core.Actually minitrace is already very thread-per-core friendly as it does thread-local span collection before batching them out to central collector.
So maybe we should use minitrace instead.
Context on how slow tokio/tracing is: https://www.youtube.com/watch?v=8xTaxC1RcXE
minitrace is probably fast enough for spans deep in the async runtime itself. We can set tracing level via features (off by default)