by abhirag · 2y ago · 0 comments
People often say that the TCP stack overhead is high but this benchmark does not confirm that.
cargo run --release -- -n 1000000 --method unixstream
cargo run --release -- -n 1000000 --method tcp
~9μs/op for unixstream, ~14μs/op for TCP.unixstream utilizes two cores at ~78% each core, tcp only utilizes ~58% of each core. so there is also something wrong in the benchmarks where blocking is happening and cores are not being fully utilized.
That said, I made sure to include serialization/deserialization (and JSON at that) to see what a realistic workload might be like.