A shitty C++ benchmarking tool for testing mathematical operations performance. Primiarly to test ARM and RISC-V Math perfomance
- 12 mathematical benchmarks
- "Multi"-threaded support
- UI designed for 80x24 display
- "Real-time" progress tracking
MathBench/
├── src/ # Source files
│ ├── main.cpp # Entry point
│ ├── MathBench.h # Main benchmark class header
│ ├── MathBench.cpp # Benchmark implementations
│ ├── UI.h # Terminal UI header
│ └── UI.cpp # Terminal UI implementation
├── build/ # Build artifacts (object files)
├── external/ # External dependencies
│ └── picosha2.h # SHA-256 hashing library
├── Makefile # Build configuration
└── mathbench # Compiled executable
apt update && apt install make g++ gcc build-essential If you don't wanna add sudo manually
sudo apt update && sudo apt install make g++ gcc build-essential For cross-compiling to different architectures:
sudo apt install \
gcc-arm-linux-gnueabi g++-arm-linux-gnueabi \
gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
gcc-riscv64-linux-gnu g++-riscv64-linux-gnumakeThis will:
- Create the
build/directory if it doesn't exist - Compile all source files
- Link the final executable
mathbench
Build for specific architecture:
make armv6 # ARMv6 (Raspberry Pi Zero, Pi 1)
make armv7 # ARMv7
make armhf # ARM Hard Float (ARMv7)
make arm64 # ARM64/AArch64 (Raspberry Pi 3/4/5, most modern ARM)
make riscv64 # RISC-V 64-bit (Milk-V, StarFive)Build all architectures at once:
make all-crossThis will create binaries:
mathbench-armv6mathbench-armv7mathbench-armhfmathbench-arm64mathbench-riscv64
Run with default settings (1 thread):
./mathbenchRun with multiple threads:
./mathbench 4Run cross-compiled binary on target device:
# Transfer binary to target device, then:
./mathbench-arm64 4- Basic Arithmetic - Addition, multiplication operations
- Trigonometry - Sin, cos, tan calculations
- Logarithm - Natural logarithm computations
- Exponential - Exponential function calculations
- Square Root - Square root operations
- SHA-256 Hashing - Cryptographic hash operations
- Array Sorting - std::sort on large arrays
- Matrix Multiplication - Dense matrix operations
- Prime Numbers (Sieve) - Sieve of Eratosthenes algorithm
- Fibonacci - Recursive Fibonacci calculation
- Monte Carlo Pi - Pi estimation using random sampling
- Fourier Transform (DFT) - Discrete Fourier Transform
Remove build artifacts:
make clean- C++17 compatible compiler (g++, clang++)
- POSIX-compatible terminal for UI features
- Linux/Unix-like operating system
See LICENSE file for details.