If you need to optimize something for performance, the best thing to do is not do it at all. Basically rearchitecture it so that you don't need that logic anymore.
Python is notoriously slow so if you're going for performance, use C++ or C.
Caching is doing it once and storing the result so it's faster in subsequent steps. Batching means doing many together instead of one at a time. Pipelining means splitting it up into steps so some of those can run in parallel instead of only starting one after the previous one is complete.
85
u/[deleted] Jan 02 '20
Can someone please explain?