Skip to content
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

Updating the comparison with Tokio's new (2019-10-13) scheduler #72

Open
Qqwy opened this issue Oct 15, 2019 · 6 comments
Open

Updating the comparison with Tokio's new (2019-10-13) scheduler #72

Qqwy opened this issue Oct 15, 2019 · 6 comments

Comments

@Qqwy
Copy link

Qqwy commented Oct 15, 2019

Tokio is switching to a new scheduler implementation. Read "Making the Tokio Scheduler 10x faster" for the details.

As such, it would be nice if a new comparison/benchmark of between May and Tokio could take place, as it means that the 'Performance' section of the current README will become outdated.

@Xudong-Huang
Copy link
Owner

Great article! Sure, I will update the doc when new tokio settle down.

@zhuxiujia
Copy link

zhuxiujia commented Apr 16, 2020

Tokio is switching to a new scheduler implementation. Read "Making the Tokio Scheduler 10x faster" for the details.

As such, it would be nice if a new comparison/benchmark of between May and Tokio could take place, as it means that the 'Performance' section of the current README will become outdated.

cant beat tokio。

fn main() {
    may::config().set_workers(6).set_stack_size(0x1);
    let total=1000000;
    for _ in 0..total{
        go!(move || {
           may::coroutine::sleep(Duration::from_secs(1*60*60));
        });
    }
    println!("done");
    std::thread::sleep(Duration::from_secs(1*60*60));
}
  • this code consume 4.44GB Memory。
  • in golang,that takes 2.35GB.
  • in tokio, this code takes only 500MB(Maybe because of zero cost abstraction).

so. i say cant beat tokio。 Maybe it's because of CSP mode. High concurrence in CSP is not high

@Xudong-Huang
Copy link
Owner

Yes, you are right, CSP consume more memory. I will update the bench data in a separate place, not in the README. For detailed io performance you can ref to https://tfb-status.techempower.com/

@Xudong-Huang
Copy link
Owner

now I place the latest simple comparison with latest tokio version under performance.md. I don't want to misleading people about real performance, people should have their own judge to select a proper tech for projects.

@zhuxiujia
Copy link

zhuxiujia commented Apr 20, 2020

Yes, you are right, CSP consume more memory. I will update the bench data in a separate place, not in the README. For detailed io performance you can ref to https://tfb-status.techempower.com/

I still don't understand why memory resource consume is higher than golang。

may::config().set_workers(6).set_stack_size(0x1);

If memory consumption is too high, it is difficult to deal with the C10K problem。

on the other hand, Future has no stack, so it can adapt to memory growth. Unless may can automatically adjust the stack like go

@Xudong-Huang
Copy link
Owner

10K coroutine will consume at least 10_000 * 4K = 40M bytes memory. 1M coroutine need 4G bytes memory at least. May don't support growth stack automatically. It's very hard for a library to grow stack dynamically. Futures are stackless, that's why the rust team choose it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants