Re:Rust is now overall faster than C in benchmarks
by tlb on Sunday January 03, 2021 @02:28PM
(#25624361)
C++ can inline the comparison function (which is often just a few instructions) at compile time. It can also statically optimize for the stride, using shifts or addressing modes instead of multiplies. C can't do either with qsort, which takes the stride and comparison function pointer as arguments.
[ Parent
| on HN ]