Scroll to the bottom if you want the recipe and skip story telling.
This is a story of software: You have a greenfield project. It’s beautiful and fast. Then you add features. For five years. Then you realize your cold start times went from ~1 second to ~5.5 seconds.
To be fair, a ton of things happened in between and I did realize that cold start time had gone up like crazy. Some mitigating steps were taken to “control” them. Although, my local tests had always shown that precompiling bytecode was the best way to improve cold start, I never managed to make it work into production. Despite the precompilation, it kept being slow.
Then comes the AI and spare time. And the conversation basically goes like
🧑🦱Me: Hey AI! I see improvements to cold start locally when I precompile my python bytecode. I don’t see it when it’s in production. I use the serverless framework. Can you tell what’s going on?
Continue reading “Recipe: Reducing cold start with precompiled python bytecode in serverless”