3 ms·
Interesting aside: There are some things that are faster in C++ than C, for example the standard library sort functions are massively faster because the compile
by willvarfar 14y ago
Interesting aside: There are some things that are faster in C++ than C, for example the standard library sort functions are massively faster because the compiler can in-line the comparison.
- aninteger 14y agoWell, yes you are correct. However if you need the fastest sorting you're probably gonna inline the comparison regardless of language. If qsort is slow due to the function pointer comparison just move it inline manually.
- jedbrown 14y agoThe performance is the same if you put the qsort implementation in a header. http://www.agottem.com/blog/inlining_qsort_sort http://www.agottem.com/blog/inlining_qsort_sort
- malkia 14y agoor use link-time compile generation (slow, and it might not work for huge projects like gcc/webkit, but if split into shared modules it can)