Mandelbrot checksum scripts for benchmarking Python 3.14's free-threaded interpreter
This repository and all of its code and data files are licensed under the MIT License.
These scripts implement a CPU-intensive workload for calculating a checksum for a Mandelbrot set.
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.
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
- Clone this repo:
git clone https://github.com/Roturgo/mandelbrot-scripts.git
- Change to the mandelbrot-scripts directory
cd mandelbrot-scripts
- Ensure that your test system has uv installed
- Install the GIL-enabled and free-threaded interpreters
uv python install cpython-3.14.0
uv python install cpython-3.14.0t
- (Optional) Verify successful installation
uv python list
- 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
- Run the Bash script to automate testing and cooldown cycles
bash ./run_tests.sh