DataDog / glommio

Glommio is a thread-per-core crate that makes writing highly parallel asynchronous applications in a thread-per-core architecture easier for rustaceans.
Other
3.12k stars 164 forks source link

glommio::net::UdpSocket::recv_from is extremely slow #672

Open bluealert opened 2 months ago

bluealert commented 2 months ago

test code is here: https://github.com/bluealert/async-udp

run udp_server first:

cargo run --release --bin udp_server
    Finished `release` profile [optimized] target(s) in 0.10s
     Running `target/release/udp_server`
[2024-08-30T10:41:20Z INFO  udp_server] Server is listening on 127.0.0.1:10000

run udp_client:

cargo run --release --bin udp_client
    Finished `release` profile [optimized] target(s) in 0.09s
     Running `target/release/udp_client`
std send: 27us
std recv: 174us

tokio send: 210us
tokio recv: 123us

glommio send: 13us
glommio recv: 14716us

monoio send: 23us
monoio recv: 75us
glommer commented 2 months ago

this is much better on the master branch, made better by commit 2047d3dcbb83bc199600837c0be167f6c0ccab4b recv is still slower than it should be, but in the ~150us range.

If you can, please point to the git tree in the mean time. I'll take a look on why this is still slower, and release a new version.

bluealert commented 2 months ago

this is much better on the master branch, made better by commit 2047d3dcbb83bc199600837c0be167f6c0ccab4b recv is still slower than it should be, but in the ~150us range.

If you can, please point to the git tree in the mean time. I'll take a look on why this is still slower, and release a new version.

Thank you!

bluealert commented 2 months ago

this is much better on the master branch, made better by commit 2047d3dcbb83bc199600837c0be167f6c0ccab4b recv is still slower than it should be, but in the ~150us range.

If you can, please point to the git tree in the mean time. I'll take a look on why this is still slower, and release a new version.

I found glommio/0.8 sometimes very fast

std send: 24us
std recv: 46us

tokio send: 67us
tokio recv: 41us

glommio send: 17us
glommio recv: 3us

monoio send: 17us
monoio recv: 49us

sometimes very slow

std send: 26us
std recv: 67us

tokio send: 61us
tokio recv: 2us

glommio send: 13us
glommio recv: 18290us

monoio send: 16us
monoio recv: 40us
bluealert commented 2 months ago

this is much better on the master branch, made better by commit 2047d3dcbb83bc199600837c0be167f6c0ccab4b recv is still slower than it should be, but in the ~150us range.

If you can, please point to the git tree in the mean time. I'll take a look on why this is still slower, and release a new version.

glommio = { git = "https://github.com/DataDog/glommio.git", rev = "d3f6e7a2ee7fb071ada163edcf90fc3286424c31" }

It's ok with above glommio version. Thank you!