←back to thread

Zlib-rs is faster than C

(trifectatech.org)
341 points dochtman | 1 comments | | HN request time: 0.205s | source
Show context
throwaway2037 ◴[] No.43385042[source]
Does this performance have anything to do with Rust itself, or is it just more optimized than the other C-language versions (more SIMD instructions / raw assembly code)? I ask because there is a canonical use case where C++ can consistently outperform C -- sorting, because the comparison operator in C++ allows for more compiler optimization compared to the C version: qsort(). I am wondering if there is something similar here for Rust vs C.
replies(1): >>43385064 #
1. anonymoushn ◴[] No.43385064[source]
these are facts about the C and C++ stdlib sort functions which nobody should really use.