Blog
Every entry, newest first — the claim, the mechanism under it, and the number that settles it.
- Entries
- 13
The GIL Is Not a Lock on Your CPU
Eight threads of pure-Python arithmetic run at 0.98x the speed of one. The same eight threads doing IO run at 7.90x. The GIL is a scheduler, and it has a dial.
What import Actually Does
Importing asyncio costs 21.9 ms and pulls in 100 modules. Importing email costs 0.1 ms and pulls in one. Granularity predicts import cost; size does not.
The Shape of a Python Object
An instance with three attributes costs 96 bytes, not the 344 sys.getsizeof reports, and __slots__ read 12% slower on the CPython 3.13.2 build measured here.