When your data doesn’t fit in memory: the basic techniques
You can process data that doesn’t fit in memory by using four basic techniques: spending money, compression, chunking, and indexing.
Helping you deploy with confidence, ship higher quality code, and speed up your application.
Visit pythonspeed.com → RSS feedOn Hacker News May 2019 – Aug 2026
Software Engineering 10Systems & Performance 5Infrastructure & DevOps 5Databases & Data 3Security & Privacy 1Tech Industry & Business 1
You can process data that doesn’t fit in memory by using four basic techniques: spending money, compression, chunking, and indexing.
Most Dockerfile examples for Python you’ll find on the Web are broken. And that’s a problem.
Alpine Linux is often recommended as a smaller, faster Docker base image. But if you’re using Python, it will slow down your build and make your image larger.
Copying data wastes memory, and modifying/mutating data can lead to bugs. Learn how to implement a compromise between the two in Python: hidden mutability.
The “official” Python Docker image is useful, but to actually understand why, and to use it correctly, it’s worth understanding how exactly it’s constructed.
Figuring out how much parallelism your program can use is surprisingly tricky.
Python-based calculations, especially those that use NumPy, can run much faster by using the Numba library.
Pydantic’s JSON loading uses a huge amount of memory; here’s how to reduce it.
Measuring your Python program’s memory usage is not as straightforward as you might think. Learn two techniques, and the tradeoffs between them.
Compilers have a hard time optimizing floating point math. Rust has a new API to fix this.