> For the complete documentation index, see [llms.txt](https://wiki.dewaka.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.dewaka.com/programming-languages/python/performance.md).

# Python performance

* [Loop optimisation](https://www.python.org/doc/essays/list2str/)
* Avoid manual looping - use generators or list comprehensions and high level functions like map where possible.
* Generators are lazy and if it fits the use case generally prefer them over list comprehensions. This choice might depend on Python version as well.
* Use [Cython](/programming-languages/python/cython.md)
