Tokio (stackless coroutines) vs. May (stackful coroutines) in Rust
crates.ioAfter investigating may_minihttp[0], which appears, for now, to be the fastest web framework on TechEmpower benchmarks[1], I saw the data below.
[0]: https://github.com/Xudong-Huang/may_minihttp [1]: https://www.techempower.com/benchmarks/#section=data-r23
==
tokio echo server
run the server by default with 2 threads in another terminal
$ cd tokio-core
$ cargo run --example=echo-threads --release
$ target/release/examples/echo_client -t 2 -c 100 -l 100 -a 127.0.0.1:8080
==================Benchmarking: 127.0.0.1:8080==================
100 clients, running 100 bytes, 10 sec.
Speed: 315698 request/sec, 315698 response/sec, 30829 kb/sec
Requests: 3156989
Responses: 3156989
target/release/examples/echo_client -t 2 -c 100 -l 100 -a 127.0.0.1:8080 1.89s user 13.46s system 152% cpu 10.035 total
may echo serverrun the server by default with 2 threads in another terminal
$ cd may
$ cargo run --example=echo --release -- -p 8000 -t 2
$ target/release/examples/echo_client -t 2 -c 100 -l 100 -a 127.0.0.1:8000
==================Benchmarking: 127.0.0.1:8000==================
100 clients, running 100 bytes, 10 sec.
Speed: 419094 request/sec, 419094 response/sec, 40927 kb/sec
Requests: 4190944
Responses: 4190944
target/release/examples/echo_client -t 2 -c 100 -l 100 -a 127.0.0.1:8000 2.60s user 16.96s system 195% cpu 10.029 total