Skip to content

swap357/pybench

Repository files navigation

Python Free-Threading Benchmarks

Overview

analysis of performance characteristics in Python's experimental free-threading support (PEP 703) for Python 3.13+.

Reference notes:

Test Structure

1. Baseline Tests

Establish baseline performance metrics:

2. Core Interpreter Tests

Bytecode Behavior

GIL Impact

Memory Management

Memory Ordering:

Reference Counting:

Specialization

Benchmark Setup - Github Actions

Runners:

  • Github actions runner:

    • CPU: 4 cores @ 2923.43 MHz
    • CPU affinity: All 4 cores
    • Memory: 15.61 GB
    • OS: Linux 6.5.0-1025-azure
  • Local machine:

    • CPU: 20 cores @ 2022.67 MHz (Intel i7-14700K)
    • CPU affinity: 2-7 (6 isolated P-cores, refer to this article for details on isolation and cpu-pinning)
    • Memory: 62.57 GB
    • OS: Linux 6.8.0-47-generic

Key Findings

Running Benchmarks

# Run all tests
python benchmark_runner.py

# Run specific category
python benchmark_runner.py --benchmarks memory/ordering/*

# Run with profiling
python benchmark_runner.py --profile detailed

System Requirements

  • Linux kernel 5.10+
  • Python versions:
    • 3.12.7 (baseline)
    • 3.13.0 (with GIL)
    • 3.13.0t (no GIL)

Results Dashboard

Future Work

study more after the following areas are addressed in Python 3.14+:

  1. Re-enabling specializing adaptive interpreter
  2. Reduced immortalization scope
  3. Improved thread-safety mechanisms
  4. Better memory usage patterns

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published