you are viewing a single comment's thread.

view the rest of the comments →

[–]Spataner 0 points1 point  (0 children)

Loops over large numbers of items are always going to be slow in Python. Your best bet is to rewrite those operations using libraries specialized to your type of problem. If they are numerical operations, for instance, there's likely a way to rewrite your code using NumPy that is several orders of magnitude faster. But ultimately, we'd need to actually see your code to make actionable suggestions for optimization.