Hello,
Please, identify the line or block of code that is the bottleneck. You can do this by commenting out all the lines, then enable a line, test, observe, enable another, test, observe, so on until you get the problem. This is a quick-and-dirty method. If you can afford the time, it is recommended to use a profiler: Profiling in Python: How to Find Performance Bottlenecks – Real Python . Profiling helps you to pinpoint the performance bottlenecks in your code.
I know you asked for a strategy. But before coming up with a strategy, you need intel, that is, to know where the bottleneck is.
all the best,
PC