News for hackers. Stuff that matters.
Re:Std::string half of all allocations in the Chrome browser... by tptacek on Friday December 05, 2014 @05:57PM (#8707425)
I expect C programs to outperform C++ programs, simply by virtue of being more explicit (about everything, from allocation to levels of indirection).
Re:Std::string half of all allocations in the Chrome browser... by vardump on Friday December 05, 2014 @06:45PM (#8707628)
Not 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.