A simple CPU benchmarker written in C++, focused on running basic arithmetic tests to evaluate CPU performance.
Benchmarker runs a suite of low-level math workloads — including addition, multiplication, division, and more — to assess how a system’s CPU handles fundamental operations.
Ideal for quick, local performance insights.
- A C++ compiler (e.g.,
g++
,clang++
, or MSVC) - Make (optional, for using the provided Makefile)
From the root directory:
make
Execute the benchmark:
./benchmarker [options]
By default, it runs all tests, measures execution time, and prints results.
- ✅ Multiple arithmetic workloads: includes addition, multiplication, division, and more
- 🔁 Configurable loop count: control the number of iterations per benchmark
- 🧪 Command-line interface: run specific tests with customizable options
- 📊 Time-based measurement: outputs elapsed time and average operation duration
- 🧼 Clean and minimal C++ codebase: easy to understand, extend, and maintain
- 🧩 Modular test design: add your own benchmarks with minimal effort
- 🖥️ Single-threaded CPU stress: tests core computation performance without parallelism
- Test Suite: Benchmarker includes a set of arithmetic test functions (e.g.,
add
,multiply
,divide
). - Loop Execution: Each test is executed repeatedly for a defined number of iterations (e.g., 100 million times).
- Timing: Uses high-resolution timers (
std::chrono
) to measure the total time taken by each test. - Result Reporting: Prints out:
- Total time taken for the operation
- Average time per operation (nanoseconds/op)
- CLI Integration: Command-line arguments allow users to choose specific tests and set loop counts.
- Performance Baseline: Helps compare CPU behavior across devices or compiler optimization levels.