Comparison TCP performance between tokio
and async_std
.
Benches done on Mac M1
Benching async_std
$ cargo run --release --bin asyncstd
$ wrk -d 10s --latency http://localhost:8080
Running 10s test @ http://localhost:8080
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 39.09us 49.32us 3.70ms 99.27%
Req/Sec 111.67k 6.29k 116.01k 95.54%
Latency Distribution
50% 36.00us
75% 42.00us
90% 52.00us
99% 75.00us
2243661 requests in 10.10s, 109.13MB read
Requests/sec: 222150.79
Transfer/sec: 10.80MB
Benching tokio
$ cargo run --release --bin tokio
$ wrk -d 10s --latency http://localhost:8080
Running 10s test @ http://localhost:8080
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 38.06us 43.86us 4.04ms 99.32%
Req/Sec 119.85k 5.49k 123.03k 98.02%
Latency Distribution
50% 35.00us
75% 42.00us
90% 53.00us
99% 76.00us
2407623 requests in 10.10s, 117.10MB read
Requests/sec: 238385.64
Transfer/sec: 11.59MB