SkillAgentSearch skills...

Pyconjp2025

Demo code for the PyConJP 2025 talk: "Beyond Multiprocessing: A Real-World ML Workload Speedup with Python 3.13+ Free-Threading"

Install / Use

/learn @kitsuyaazuma/Pyconjp2025
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

| Link | Description | |:---|:---| | Blog Post | A detailed article based on this presentation. | | Slides | The slides used for the talk at PyCon JP 2025. | | BlazeFL | The free-threading based Federated Learning framework. |

pyconjp2025

This repository contains the demonstration code for the PyConJP 2025 talk: "Beyond Multiprocessing: A Real-World ML Workload Speedup with Python 3.13+ Free-Threading".

It provides a suite of benchmarks designed to compare the performance of standard CPython (with the Global Interpreter Lock) against the free-threading build of CPython 3.14.

Benchmarks

The following benchmarks are included:

  • Prime Counting: A CPU-bound task that counts prime numbers up to a given limit, implemented with both threading and multiprocessing.

  • Array Summation: Another CPU-bound task that calculates the sum of a large NumPy array using different concurrency models: threading, multiprocessing, and multiprocessing with shared memory.

Getting Started

Prerequisites

  • uv package manager

Setup

1. Clone the repository

git clone https://github.com/kitsuyaazuma/pyconjp2025.git
cd pyconjp2025

2. Install dependencies:

uv sync

3. Set up Python environment:

  • With GIL (Standard CPython):

    make gil
    
  • Without GIL (free-threading CPython):

    make nogil
    

Running the Benchmarks

To run the full suite of benchmarks:

uv run python main.py

The script will execute each benchmark with a range of worker counts, displaying the results in the console and saving them as CSV files and PNG graphs in the results/ directory.

You can customize the number of runs for each benchmark using the --runs option:

uv run python main.py --runs 5

Running Individual Benchmarks

You can also run each benchmark as a Python module to have more control over the parameters.

  • Array Summation Benchmark:

    uv run python -m benchmark.cases.array_sum --max-workers 8 --runs 10 --size 100000000
    
  • Prime Counting Benchmark:

    uv run python -m benchmark.cases.array_sum --max-workers 8 --runs 10 --size 100000000
    
View on GitHub
GitHub Stars4
CategoryDevelopment
Updated5mo ago
Forks0

Languages

Python

Security Score

87/100

Audited on Oct 4, 2025

No findings