3 ms·
There are cases for more performance as well, e.g. C's qsort vs C++'s std::sort - for the latter, the comparison function can be inlined (e.g. default less oper
by zerr 9y ago
There are cases for more performance as well, e.g. C's qsort vs C++'s std::sort - for the latter, the comparison function can be inlined (e.g. default less operator).
- faragon 9y agoC++ sort is faster than qsort mainly because it uses radix sort for integer data in most implementations. You can use radix sort in C, too, e.g. some benchmarks [1] [1] https://github.com/faragon/libsrt/blob/master/doc/benchmarks.md https://github.com/faragon/libsrt/blob/master/doc/benchmarks...