4 ms·
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 late
by PEJOE 5y ago
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?
- danuker 5y agoMy money is on garbage collection. In Rust it can happen from compile time: https://stackoverflow.com/a/32677591/235463 https://stackoverflow.com/a/32677591/235463
- gpapilion 5y agoYes 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.
- PEJOE 5y agoThat doesn’t explain C++’s poor tail performance, unless it’s just poorly optimized like the top comment suggested
- 0x000000E2 5y agoI'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.