4 ms·
You can write terser code in C++ but not more efficient. Pretty much the same performance. Perhaps you meant that the programmer can be more productive; sure.
by CalChris 9y ago
You can write terser code in C++ but not more efficient.
Pretty much the same performance. Perhaps you meant that the programmer can be more productive; sure.
- zerr 9y agoThere 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...