News for hackers. Stuff that matters.
Re:Comparison of Rust async and Linux thread context switch ... by continuations on Thursday February 11, 2021 @11:15PM (#26110675)
How does Rust async compare to Goroutine, Erlang threads, Javascript async, Java async in performance and memory usage? Is there any benchmarks for that?
Re:Comparison of Rust async and Linux thread context switch ... by uniquefine on Friday February 12, 2021 @02:43AM (#26111487)
There 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_t...
Re:Comparison of Rust async and Linux thread context switch ... by redrobein on Friday February 12, 2021 @12:06AM (#26110925)
Rust 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.

Re:Comparison of Rust async and Linux thread context switch ... by scottlamb on Friday February 12, 2021 @12:38AM (#26111037)
I'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.)
Re:Comparison of Rust async and Linux thread context switch ... by sam0x17 on Thursday February 11, 2021 @11:17PM (#26110683)
And also Crystal fibers
Re:Comparison of Rust async and Linux thread context switch ... by monadic3 on Thursday February 11, 2021 @11:54PM (#26110863)
Which rust async runtime are you referring to?
Re:Comparison of Rust async and Linux thread context switch ... by continuations on Thursday February 11, 2021 @11:57PM (#26110882)
Say Tokio, the async runtime used in OP's article.