Early previewThis guide is in development. Items tagged verify are still being checked against official docs.
nebx Learn
GitHub
Menu
Home/Python/Performance
Py

Python

Readable, batteries-included, and the default language of AI.

Paradigm
Multi-paradigm, OOP, functional
Typing
Dynamic, strong, optional type hints
Memory
Reference counting + cycle GC
Runs
CPython bytecode interpreter
Concurrency
asyncio, threads (GIL), multiprocessing

Performance

How Python runs, and what that means in practice.

Execution model

CPython interprets bytecode; 3.11 and later brought significant interpreter speed-ups, and an experimental JIT is being developed.

Memory

Reference counting plus a cyclic garbage collector; objects carry notable per-object overhead.

Concurrency

The GIL limits threads to one running Python bytecode at a time; use asyncio for I/O, multiprocessing for CPU. A free-threaded (no-GIL) build is available in recent versions.

In practice verify

Pure-Python CPU loops are among the slowest of the six; libraries written in C, C++ or Rust (NumPy, PyTorch, Polars) make real workloads fast.

Compare with the other five languages →

Saved in this browser only. Part of From code to production (0/5).