C++ Compilers' Performance. Implementation's quality
There is a certain number of publications available in the Internet which
compare performance of a code generated by different C++ compilers on various
hardware platforms for some test tasks (e.g. a review on the 'coyote gulch' site).
This type of reviews is also issied by compiler manufacturers to draw attention
to their products. Surely this type of reviews is very practical;
they help to take into account a factor of the generated code absolute performance
while selecting a development toolchain.
At the stage when a compiler has already been selected, however, a developer faces
a question of what approach should be used for implementation a particular piece of
code. As soon as any C++ compiler is able to compile a C code as well there is always
a choice: to use new language features provided by C++ or to implement the same
functionality in pure C. In other words there is a question of overheads which are
introduced by new C++ features or how well the corresponding feature is implemented
by a certain C++ compiler.
There are not too many comparisons of a performance a C++ code and a functionally equivalent
C code which are generated by the same compiler. In fact there is only one well known
source - it is 'Technical Report on C++ Performance' issued by WG21 committee.
The report gives specific numbers and the used test code while the compilers are left
anonymous. The logic of the committee is understandable however practicing engineers
need more specific information.
The above mentioned report is taken as a basis for the article. The set of tests was extended;
the code was modified in some cases and the more detailed analysis of the incurred overheads
is provided. In most cases the exact figures are given for each pair: a compiler - a hardware
platform. The reader may get an answer not only for the question 'what overheads are incurred
by that language feature?' but for the question 'how big are those overheads?' as well.