Continuing the previous post, a video that greatly influenced me with thoughts about optimization. There was such a thought that when you speed up code, you want a gain of x5-10, not some 10-20%, because time spent on optimization will be more than the cost of developer time you spent on optimization.
The video tells what ways exist to speed up Python code by 10-20 times and what generally makes sense to do and what not so much.
https://www.youtube.com/watch?v=77B2-Pk1fls