You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem related to your feature request.
The new completion-based async IO APIs have the potential to improve performance for a few reasons. Unfortunately, tokio/mio is designed around the old readiness model (kqueue/epoll) and thus does not support io_uring on Linux, "io ring" on Windows, etc.
There may also be some performance to be gained by avoiding the overhead and "bloat" of the tokio runtime's task scheduler.
What solution would you like?
Abstract away the socket and HTTP request code in valence_network behind a Backend struct. Then, implement two backends:
Backend based on monoio for Linux and macOS (Windows support coming soon?).
Backend based on tokio for platforms not supported by monoio. (or if monoio feature flag is not enabled)
Then, measure if performance is improved with monoio under heavy load. If not, then the changes are likely not worth the complexity and maintenance burden.
To what extent does reqwest/hyper depend on tokio? That could be a problem. Other than a single HTTPS fetch for authentication, we don't need anything beyond plain TCP and UDP support.
What alternative(s) have you considered?
Instead of monoio, we could use...
tokio-uring. Maintained by the tokio project. I chose monoio because they claim to be more efficient and it has more platform support. Although the nightly compiler requirement is unfortunate.
glommio. Seems like a subset of what monoio offers. Although no nightly requirement.
Describe the problem related to your feature request.
The new completion-based async IO APIs have the potential to improve performance for a few reasons. Unfortunately,
tokio
/mio
is designed around the old readiness model (kqueue/epoll) and thus does not support io_uring on Linux, "io ring" on Windows, etc.There may also be some performance to be gained by avoiding the overhead and "bloat" of the tokio runtime's task scheduler.
What solution would you like?
Abstract away the socket and HTTP request code in
valence_network
behind aBackend
struct. Then, implement two backends:Then, measure if performance is improved with monoio under heavy load. If not, then the changes are likely not worth the complexity and maintenance burden.
To what extent does reqwest/hyper depend on tokio? That could be a problem. Other than a single HTTPS fetch for authentication, we don't need anything beyond plain TCP and UDP support.
What alternative(s) have you considered?
Instead of monoio, we could use...
Additional context
See this article for the differences between readiness and completion models: https://www.ncameron.org/blog/async-io-fundamentals/
The text was updated successfully, but these errors were encountered: