A C++ version of the Are-we-fast-yet benchmark suite
The Are-we-fast-yet benchmark suite, previously available only for Java and JavaScript, now has a C++ version thanks to Rochus Keller. The benchmark suite is designed to measure the performance of different programming languages and their implementations. It consists of a set of micro-benchmarks that test various aspects of a language's performance, such as arithmetic operations, memory allocation, and function calls.
The C++ version of the benchmark suite includes 29 micro-benchmarks that test the performance of different C++ features, such as templates, exceptions, and virtual functions. The benchmarks are designed to be run on different compilers and platforms to provide a comprehensive view of C++ performance.
Developers can use the Are-we-fast-yet benchmark suite to compare the performance of different C++ compilers and optimization settings. The suite can also be used to identify performance bottlenecks in C++ code and to optimize it for better performance.
Here's an example of how to run the benchmark suite on a Linux machine using the GCC compiler:
git clone https://github.com/rochus-keller/Are-we-fast-yet.git
cd Are-we-fast-yet/Cpp
make -f Makefile.gcc
./run.sh
The output of the benchmark suite includes the execution time of each micro-benchmark and a summary of the results. Developers can use this information to identify the fastest and slowest performing C++ features and to optimize their code accordingly.
Overall, the Are-we-fast-yet benchmark suite is a valuable tool for C++ developers who want to optimize their code for better performance. The addition of a C++ version of the suite provides developers with a comprehensive view of C++ performance across different compilers and platforms.