Re:Why C++ is back
by blablabla123 on Monday December 03, 2012 @04:51PM
(#4868075)
Once I worked on a C++ program and when we really had to optimize, I did some profiling with valgrind. It turned out more than 50% of the CPU time was spend with memory allocations...
However with C++ it's easy to work around that by using pointers or (const) references. Or even one step further one can use a memory pooler or GC.
C# and Java can produce very efficient programs, and for a lot of CPU-bound problems the obvious solution in either of those will be faster, particularly stuff that needs to perform lots of little allocations or where the obvious C++ program does too much accidental copying.