In the task
documentation, there's a section that talks about calling blocking code in async, and how that should be avoided as to not block the async thread too much (https://docs.rs/tokio/1.21.2/tokio/task/index.html#blocking-and-yielding).
It also talks about using tokio::task::spawn_blocking
for these tasks, but I'm wondering at which point sending the work to a different thread is recommended? I'm currently writing a program that recovers a large amount of ecdsa signatures, which takes about 100 microseconds per message, all while doing a large amount of network IO. As a concrete example, is this enough to use things like spawn_blocking
?