🧠 One of the most underused yet insanely powerful Python tools for performance optimization — the Least Recently Used (LRU) cache.
If your code recomputes expensive function calls, this decorator can change everything.
How I cut my CI/CD pipeline from 12 minutes to 4 minutes.
Changes:
- Parallelised long running test jobs (i.e. end-to-end tests with selenium).
- Properly cached external dependencies installation (i.e. npm install / uv sync) and Docker layers.
GitLab runner costs dropped 60%.
I’ve just tried using Pyrefly and Ty in a python project with an existing codebase.
The Rust based type checkers run circles around mypy and pyright, and Purefly does seem stricter than Ty. A small example: