3 ms·
How does Rust async compare to Goroutine, Erlang threads, Javascript async, Java async in performance and memory usage? Is there any benchmarks for that?
by continuations 6y ago
How does Rust async compare to Goroutine, Erlang threads, Javascript async, Java async in performance and memory usage? Is there any benchmarks for that?
- sam0x17 6y agoAnd also Crystal fibers
- monadic3 6y agoWhich rust async runtime are you referring to?
- continuations 6y agoSay Tokio, the async runtime used in OP's article.
- redrobein 6y agoRust doesn't have a standard async runtime, so the question would be "how does tokio compare to goroutine, etc..." since that's the most popular one. Looking at the techempower benchmarks, the projects using tokio generally outperform Go, Java, so I'm guessing it's on par or better. Hypothetically, you could port goroutines exact behavior to rust and use that as your wanted to too.
- scottlamb 6y agoI'd think mostly similar. Goroutines are "stackful" coroutines, though, so their memory use will be higher. They have an interesting stack copying model, so I'm not sure if they require as many pages as POSIX threads do. (Having a "denser" memory space and no guard page requirement would mean you could use huge pages and thus have much less TLB pressure.)
- uniquefine 6y agoThere were benchmarks and a discussion on this on reddit recently comparing goroutines to tokio. If I recall correctly tokio was slower than goroutines but if you set the right settings it could be almost as fast. https://www.reddit.com/r/rust/comments/lg0a7b/benchmarking_tokio_tasks_and_goroutines/ https://www.reddit.com/r/rust/comments/lg0a7b/benchmarking_t...