1. Use generators, because you can save a lot of memory.
2. Loop code optimization to avoid the execution of too much repetitive code.
3. Multi-process, multi-thread, coroutine
4. Multiple if else condition judgments can determine the most likely occurrence. The conditions are written in the front, which can reduce the number of judgments of the program and improve efficiency
Python methods to improve code efficiency
Guess you like
Origin blog.csdn.net/qq_46620129/article/details/113446771
Ranking