There are numbers every Python programmer should know. For example, how fast or slow is it to add an item to a list in Python? What about opening a file? Is that less than a millisecond? Is there something that makes that slower than you might have guessed? If you have a performance sensitive algorithm, which data structure should you use? How much memory does a floating point number use? What about a single character or the empty string? How fast is FastAPI compared to Django?
I wanted to take a moment and write down performance numbers specifically focused on Python developers. Below you will find an extensive table of such values. They are grouped by category. And I provided a couple of graphs for the more significant analysis below the table.
Source code for the benchmarks
This article is posted without any code. I encourage you to dig into the benchmarks. The code is available on GitHub at:
https://github.com/mikeckennedy/python-numbers-everyone-should-know
📊 System Information
The benchmarks were run on the sytem described in this table. While yours may be faster or slower, the most important thing to consider is relative comparisons.
Property Value Python Version CPython 3.14.2 Hardware Mac Mini M4 Pro Platform macOS Tahoe (26.2) Processor ARM CPU Cores 14 physical / 14 logical RAM 24 GB Timestamp 2025-12-30
Python numbers you should know
More analysis and graphs by category below the table.
... continue reading