The CPU benchmark is a python project that allows you to measure and benchmark the performance of your CPU (single and multi threads) using various algorithms. Result of the each algorithm includes:
- Elapsed time
- Number of operations performed in a specific time
- Number of operations performed in a second
-Single-threaded performance benchmarking -Multi-threaded performance benchmarking -Easy-to-use command-line interface -Customizable duration for single and multi threaded benchmark tests
- Clone the repository to your local system
git clone https://github.com/rastr-0/CPU_benchmark.git
- Change your working directory to the project folder:
cd CPU_benchmark
- Install the requered dependencies
pip install -r requirements.txt
The CPU Benchmark project provides a simple and convenient command-line interface (CLI) to run benchmark tests. You can browse all the details about using CLI with the --help command. Here are examples of using CLI:
- To run a single-threaded and multi-threaded tests with the specific time 10 seconds
python3 CPU_benchmark.py --t_std 10 --t_mtd 10
- To run only single-threaded tests with the specific time 15 seconds
python3 CPU_benchmark.py --no_mtd --t_std 15
- To run only multi-threaded tests 3 times with the default time(15 seconds):
python3 CPU_benchmark.py --no_std --n_mtd 3
- To run a single-threaded and multi-threaded tests 3 times with the specific time 12 seconds:
python3 --t_std 12 --n_std 3 --t_mtd 12 --n_mtd 3
- Single-threaded performance: Measures how fast your CPU can perform a specific tests in a single-thread
- Factorization
- Pi calculation
- Matrix multiplication
- Fibonacci calculation
- Multi-threaded performance: Measures how fast your CPU can perform a specific tests in multi-threadeds
- Matrix multiplication
- Fibonacci calculation
- No ability to set the execution time of the fibonacci calculation tests
- The way fibonacci calculation is implemented for single and multi threads doesn't look like good.
- Right now there are 2 separete files for multi and single fibonacci tests, ideally, these tests should be added to other single and multi tests, respectively. So, the project structure will remain clear and simple
If you want to contribute to this project, feel free to open issues, submit pull requests, or suggest improvements.
This project is licensed under the MIT License.