Tutorial sequence

Faster Python, Measured

6of 6 published
  1. 01

    intermediate / 28 min

    How to benchmark Python without lying to yourself

    Design repeatable timing experiments that measure the workload you actually care about.

    Read
  2. 02

    intermediate / 30 min

    Profile first: finding where the time actually went

    Use cProfile and pstats to locate expensive call paths before choosing what to optimize.

    Read
  3. 03

    intermediate / 32 min

    The fastest operation is the one your algorithm avoids

    Remove repeated work with better structures, indexes, sorting strategies, batching, and precomputation.

    Read
  4. 04

    advanced / 31 min

    Allocation is work: object churn and memory locality

    Measure temporary objects, retained memory, and data layout before trading clarity for reuse.

    Read
  5. 05

    advanced / 30 min

    What CPython's specializing interpreter optimizes for you

    Inspect how CPython 3.14 adapts hot bytecode to stable runtime types, and where it cannot help.

    Read
  6. 06

    advanced / 33 min

    Crossing the Python boundary

    Move useful work across Python, native, I/O, and process boundaries without optimizing the wrong crossing.

    Read