Python's Integer Overhead: Up to 7x More Memory

A Python integer, even for small values, typically consumes around 28 bytes on a 64-bit system, compared to 4 or 8 bytes for a C integer, due to metadata like reference counts, type pointers, and variable-length object information.

Sources

Open the full topic