Primes
The primes_benchmark.py
script in this repository aims to evaluate the performance of generating prime numbers using Python and Cython implementations. It generates primes and compares the execution times between the two implementations. By running the primes_benchmark.py
script, you can assess the efficiency of algorithm and observe the performance improvements achieved by leveraging Cython’s optimizations. This benchmark provides valuable insights into the impact of algorithmic choices and the benefits of utilizing Cython to optimize prime number generation.
To run the Prime benchmark, follow the instructions below:
- Ensure that you have Python and Cython installed on your system. Refer to the installation instructions in the repository’s README.md for more information.
- Clone the repository to your local machine.
- Open a terminal and navigate to the location of the
primes_benchmark.py
script. - Run the script using the appropriate Python command (e.g.,
python primes_benchmark.py
). - The script will execute the Prime numbers generation for a specified input and measure the execution time for both Python and Cython implementations.
- The output will display the execution times for each implementation and saved in
primes_output.txt
, allowing you to observe the performance differences between Python and Cython.
Feel free to experiment with different input values and compare the execution times to gain insights into the speed improvements achieved by utilizing Cython for Primes number generation.