FREE Python, inside out LESSON · Python, inside out
From source to system call
Bytecode, runtime, native code, and I/O
The interpreter is part of the program’s machine.
A typical CPython execution parses source, compiles code objects to bytecode, and evaluates instructions against frames containing stack and namespace state. Many operations enter optimized C implementations; I/O crosses into the kernel; third-party numerical libraries may release the interpreter lock and use native threads. Performance diagnosis must locate the work before selecting a remedy.
“Python is slow” is not a location in a trace.
Bytecode is evidence, not the language contract.
Disassembly can reveal repeated work, control flow, and implementation changes, but CPython bytecode may vary across versions and other Python implementations behave differently. Use it to investigate a concrete runtime after the language-level model is clear. Measure with representative inputs and separate CPU time, allocation, lock contention, and I/O wait.
Move down a layer only when the higher layer cannot answer the question.