Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will I get a performance boost when compiling with a C++14 compiler instead of C++11?

I know you can get a performance boost when compiling with a C++11 compiler instead of a C++03 compiler (see this question).

But can I expect a performance boost when going from a C++11 compiler to a C++14 compiler?

If so, can you show me a code sample that will be faster when compiled with C++14 instead of C++11.

like image 954
Romain Avatar asked Apr 29 '15 16:04

Romain


People also ask

Which compiles faster C or C++?

C++ C++ is one of the most efficient and fastest languages. It is widely used by competitive programmers for its execution speed and Standard Template Libraries(STL).

Can you compile a .C file with a .cpp compiler?

If the C++ compiler provides its own versions of the C headers, the versions of those headers used by the C compiler must be compatible. Oracle Developer Studio C and C++ compilers use compatible headers, and use the same C runtime library. They are fully compatible.

Does C++ run as fast as C?

Performance-based on Nature Of Language C++ language is an object-oriented programming language, and it supports some important features like Polymorphism, Abstract Data Types, Encapsulation, etc. Since it supports object-orientation, speed is faster compared to the C language.

Is Intel compiler faster than GCC?

With 1 parallel copy, UnixBench compiled with Intel's is about 20% faster than the version compiled with GCC. However this hides huge differences. Dhrystone is about 25% slower with Intel compiler, while Whetstone runs 2x faster.


1 Answers

There is a core language change in C++14 that allows the implementation to merge memory allocations, see N3664. If your compiler/optimizer takes advantage of this allowance, you may see a performance improvement.

like image 55
T.C. Avatar answered Sep 30 '22 17:09

T.C.