2 ms·
Of all the things you shudl expect from a non-C++ language, performance is highly unlikely to be on that list. If you can't get something to be performant with
by DannyBee 12y ago
Of all the things you shudl expect from a non-C++ language, performance is highly unlikely to be on that list.
If you can't get something to be performant with C++, it's pretty unlikely you'll get it to be performant with most other languages.
(Unless you want to try it in fortran)
- tptacek 12y agoI expect C programs to outperform C++ programs, simply by virtue of being more explicit (about everything, from allocation to levels of indirection).
- vardump 12y agoNot always faster. Try comparing qsort to stl::sort... Hint: stl::sort is a lot faster. It can inline the comparison function. Ok, it just shows how slow function pointers are. I'm assuming compilers still can't optimize the function pointer away in qsort. Of course a specialized sorter in C would be faster, one that can inline comparison function. C++ copy pasting automation... err, I mean templates are useful, because it can often inline your function and data type in the algorithm without using function pointers. At cost of generating same or similar algorithm code multiple times bloating the binary.