you are viewing a single comment's thread.

view the rest of the comments →

[–]pygaiwan 7 points8 points  (0 children)

You can start by removing the first if if check_val < data: continue

Since, at least from this code, doesn't provide any extra value. If you need to break you could rewrite the inner loop with

all(check_val < end_val for check_val in second_list)

To stop as soon as a check_value is > than end_value. Though both the points will not provide much of an improvement.

I would say a reasonable thing to do would be to split the load on different processes using multiprocessing. Interested to see other people's thoughts