Re:Rust is now overall faster than C in benchmarks
by rurban on Sunday January 03, 2021 @05:45PM
(#25625956)
Don't use a libc qsort then. The compiler could generated it (but they don't even generate optimized memcmp yet).
Or the CTL is a header only STL for C, which inlines the sort function and the comparator. And because of the C++ bloat and indirect calls the C version is faster.
Or the CTL is a header only STL for C, which inlines the sort function and the comparator. And because of the C++ bloat and indirect calls the C version is faster.
Inlining with macros == constexpr with templates.
You can decide which syntax you prefer.