Welcome to Bench Cplusplus
, a repository dedicated to benchmarking various aspects of C++ code, including performance, memory usage, and efficiency of different programming constructs. This project is designed to help C++ developers understand the trade-offs of different approaches and optimize their applications.
Bench Cplusplus
is a minimalistic benchmarking project designed to help developers measure the execution time of common C++ code snippets and functions.
- A modern C++ compiler supporting C++17 or higher:
- CMake 3.16 or higher
- Clone the repository:
git clone https://github.com/allvphx/bench-cplusplus.git
- Build the project:
mkdir build
cd build
cmake ..
make
- Run benchmarks
./cplusplus_efficiency
taskset -c 0 ./cplusplus_efficiency
For more details about the benchmarking functions, please refer to:
- Function Call: complexity v.s. efficiency (virtual and CDPR), binary size v.s. efficiency (non-inline and inline), flexibility v.s. efficiency (indirect calls and regular calls, CDPR and virtual).