https://chavkov.com/posts/python-performance-optimization-techniques/