Skip to content

Lowband21/prime_bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prime Bench - A Prime Number Finding Benchmark Program

Overview

Do you have hardware just sitting there after having burnt a hole through your wallet? Do you want to see it sweat? Have I got the program for you, Prime Bench is a benchmark program written in Rust, optimized for multi-threaded performance and single-threaded use. The program aims to search for prime numbers using a Monte Carlo method based on the Solovay-Strassen primality test, and in the process, measure the performance of your system. The program allows users to perform this benchmark in either single core or all core mode, giving flexibility in terms of understanding the capability of the hardware in both scenarios.

Key Features

  • Solovay-Strassen Primality Test: The program utilizes the Solovay-Strassen algorithm to perform a Monte Carlo method of prime number identification. This approach ensures that the search is both efficient and highly accurate.
  • Concurrency: The program is designed to operate both in a single-threaded environment and a multi-threaded environment. It utilizes the power of concurrent computing to speed up the process when multiple cores are available.
  • Scalable Workload: The workload for each core can be scaled using a user input "scale factor", which makes the benchmarking process adaptable to various system capabilities.
  • Interactive User Interface: The program includes a command-line interactive user interface for an easy-to-navigate experience.

Installation

Download Binary

Just navigate to the releases page and download either the Linux or Windows binary

Install with Cargo

Just install cargo and run:

cargo install prime_bench
prime_bench

Build from Source

First, clone the repository:

git clone https://github.com/YourGitHub/prime_explorer.git
cd prime_bench

Then, run the project with cargo:

cargo run --release

The program will prompt you to choose between "Multi-thread" or "Single-thread". Depending on your choice, it will run the program utilizing either multiple cores or a single core.

Next, you will be asked to enter a scale factor. This number is a multiplier for the base workload per core, allowing you to adjust the duration and intensity of the benchmark.

The program will then generate and test random numbers for primality. Finally, it will output the number of primes found, total attempts made, time taken, and the score which indicates the number of tries per second.

Known Issues:

The GUI version of the program will crash under Wayland if run as a native Wayland window. The solution for the moment is to prefix with WINIT_UNIX_BACKEND=x11

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages