Skip to content

Mandelbrot checksum scripts for benchmarking Python 3.14's free-threaded interpreter

License

Notifications You must be signed in to change notification settings

Roturgo/mandelbrot-scripts

Repository files navigation

mandelbrot-scripts

Mandelbrot checksum scripts for benchmarking Python 3.14's free-threaded interpreter

License

This repository and all of its code and data files are licensed under the MIT License.

Background:

These scripts implement a CPU-intensive workload for calculating a checksum for a Mandelbrot set.

Purpose:

These scripts were used to benchmark Python 3.14's new free-threaded interpreter against the classic GIL-enabled build for a CPU-bound workload.

Files:

Several versions of the benchmarking scripts were created to test out a sequential implementation, a multi-processing implementation, and a threaded implementation. A Bash driver script to automate testing and CPU cooldown cycles is also provided.

The respective files are:

  • mandelbrot_baseline.py --> sequential implementation
  • mandelbrot_multiprocessing.py --> an implementation using Python's standard multiprocessing library
  • mandelbrot_threading.py --> an implementation using Python's standard threading library
  • run_tests.sh --> a Bash script to automate testing of each Python script against the GIL-enabled Python 3.14 interpreter as well as the free-threaded Python 3.14 interpreter

Running the Code:

  1. Clone this repo:
git clone https://github.com/Roturgo/mandelbrot-scripts.git
  1. Change to the mandelbrot-scripts directory
cd mandelbrot-scripts
  1. Ensure that your test system has uv installed
  2. Install the GIL-enabled and free-threaded interpreters
uv python install cpython-3.14.0
uv python install cpython-3.14.0t
  1. (Optional) Verify successful installation
uv python list
  1. Sync and activate a python virtual environment to ensure installed python interpreters are in your shell's $PATH
uv sync -U
source .venv/bin/activate
  1. Run the Bash script to automate testing and cooldown cycles
bash ./run_tests.sh

About

Mandelbrot checksum scripts for benchmarking Python 3.14's free-threaded interpreter

Topics

Resources

License

Stars

Watchers

Forks