I am developing an interpreter in Rust to execute Rholang, which is a truely parallel language.
So there are a lot of small chunks of code to be executed parallelly. So they are heavily relying on Rust's futures and await
.
I tried both tokio and async-std runtime.
Source code basing on tokio is here. Its flame graph shows 60.58% time is spent on tokio-runtime
. :
Source code basing on async-std is here. Its flame graph shows 79.44% time is spent on async-std/runtime
.
These 2 editions' codes are almost the same, except that different task::spawn
is used.
Tokio is faster in my case. But can I reduce its overhead? Maybe the old-style of future-rs combinators would be better?
Thank you in advance.