News for hackers. Stuff that matters.
Re:gRPC benchmark results by PEJOE on Saturday May 08, 2021 @10:41AM (#27087524)
Looking at the 99% times and memory usage, it looks to me like rust came out on top if you’re looking at best worst-case performance. Any idea why the tail latency was so much better for rust vs Java or c++? E.g. specific work that went into it or language optimizations?
Re:gRPC benchmark results by 0x000000E2 on Saturday May 08, 2021 @01:43PM (#27089236)
I've heard the anecdote many times that the idiomatic way of writing Rust tends to also be performant. I've spent some time fiddling with C code to reuse buffers and avoid copies, make loops amenable to auto vectorization. Many times my first try in Rust will still be faster. In C reusing memory over and over is dangerous and confusing. In Rust it's the default because you use borrowing and transfer ownership.

My guess is that little time was spent optimizing the C++ and Rust codebase, and Rust performs better because the code doesn't do copies.

Re:gRPC benchmark results by danuker on Saturday May 08, 2021 @11:39AM (#27088107)
My money is on garbage collection. In Rust it can happen from compile time: https://stackoverflow.com/a/32677591/235463
Re:gRPC benchmark results by PEJOE on Saturday May 08, 2021 @01:37PM (#27089205)
That doesn’t explain C++’s poor tail performance, unless it’s just poorly optimized like the top comment suggested
Re:gRPC benchmark results by gpapilion on Saturday May 08, 2021 @11:49AM (#27088207)
Yes it’s hard to tell without looking at the Java options. But especially since it’s a single cpu benchmark, it’s likely something blocked for a period of time.