Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a good test for C++ optimizing compilers?

I'm evaluating Visual C++ 10 optimizing compiler on trivial code samples so see how good the machine code emitted and I'm out of creative usecases so far.

Is there some sample codebase that is typically used to evaluate how good an optimizing C++ compiler is?

like image 963
sharptooth Avatar asked Sep 12 '11 10:09

sharptooth


People also ask

Does LTO improve performance?

LTO provides a performance boost for all the compilers. With small projects, this boost probably wouldn't be noticeable, but for big ones this option definitely makes a difference.

What is compiler optimization in C?

Compiler optimization is generally implemented using a sequence of optimizing transformations, algorithms which take a program and transform it to produce a semantically equivalent output program that uses fewer resources or executes faster.

Which is the fastest C compiler?

The Zapcc is the fastest compiler in our compile test. LLVM and Clang have relatively good documentation, although it can be somewhat unclear as to which version of the product the documentation refers to. The Zapcc compiler relies entirely on the standard LLVM documentation.


2 Answers

The only valid benchmark is one that simulates the type of code you're developing. Optimizers react differently to different applications and different coding styles, and the only one that really counts is the code that you are going to be compiling with the compiler.

like image 109
James Kanze Avatar answered Oct 26 '22 07:10

James Kanze


Try benchmarking such libraries as Eigen (http://eigen.tuxfamily.org/index.php?title=Main_Page).

like image 27
quant_dev Avatar answered Oct 26 '22 07:10

quant_dev