-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rt: initial implementation of new threaded runtime #5823
Conversation
This patch includes an initial implementation of a new multi-threaded runtime. The new runtime aims to increase the scheduler throughput by speeding up how it dispatches work to peer worker threads. This implementation improves most benchmarks by about ~10% when the number of threads is below 16. As threads increase, mutex contention deteriorates performance. Because the new scheduler is not yet ready to replace the old one, the patch introduces it as an unstable runtime flavor with a warning that it isn't production ready. Work to improve the scalability of the runtime will most likely require more intrusive changes across Tokio, so I am opting to merge with master to avoid larger conflicts.
Can you detail the "speeding up how it dispatches work to peer worker threads. " compared with original impl of threaded runtime? |
@inevity I plan to write about it in detail later. However, I don't expect the implementation currently in the PR to stay as is. |
Finally green! |
@carllerche Hi, I'd like to get some details about it, where can I get it besides reading the implementation directly? Much appreciated! |
are there any more benchmarks here? Just looking at the hyper benchmark in the original PR comment, looks like average latency/throughput is better but with higher variance/jitter. |
Not at the moment. |
This patch includes an initial implementation of a new multi-threaded runtime. The new runtime aims to increase the scheduler throughput by speeding up how it dispatches work to peer worker threads. This implementation improves most benchmarks by about ~10% when the number of threads is below 16. As threads increase, mutex contention deteriorates performance.
Because the new scheduler is not yet ready to replace the old one, the patch introduces it as an unstable runtime flavor, warning it isn't production ready. Work to improve the scalability of the runtime will most likely require more intrusive changes across Tokio, so I am opting to merge with master to avoid more significant conflicts. I don't intend ever to stabilize a new runtime flavor. Instead, once the new scheduler is ready, it will replace the current one.
As an example of benchmarks, here is Hyper hello world: https://gist.github.com/carllerche/7ac6924ad3ab1bb8e1a289fd96043636
I'm not sure if duplicating tests, including loom tests, is the best strategy here.