Okay, so i have been checking upon my old submissions, finding new ways to optimize them, i came across with these unusual thing, While i truly follow C++11 for my programming, it seems that there are really a few drawbacks of using C++11.
While many C++11 programs would compile under C++4.3.2 as well(those who don’t use C++11 exclusive things) , there are some performance issues.
I started this simple test, by submitting my code for the problem
The very exact same code, give different results when compiled under different tags.
C++4.3.2 : 4098035
C++11 : 4097980
Interesting enough, the Execution time for for both were:
C++11 : 0.02sec
C++4.3.2 : 0.00sec
and not only that, we see memory usage for them are:
C++11 : 3.4M
C++4.3.2 : 2.8M
So i wonder, what exactly happens when the program is compiled under C++11? , does this mean C++11 is somewhat BAD for an enviroment with limited resources ? , if so, then why bother developing a new standard than is worse than the previous?.
Also Does using better compiler techniques ( Code::Blocks->Settings->Compiler->Compiler Flags->Optimize for speed ) help in improving the speed?. If so, should’nt you think than there should be compilation standard set for such optimizations?
now, who would compromise performance for a better library ? …
Here is a similar question, i asked on SO : http://stackoverflow.com/questions/24255622/why-c11-programs-are-slower-than-c4-3-2