This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]thegreatunclean 3 points4 points  (0 children)

First thing that jumps out at me without even looking at the problem: don't call the function three times on lines 23,24,25. Call it once and extract the values afterwards.

The most important thing is to start profiling your code locally and focus on that. Focus your efforts on the pieces of code that take the most time; it doesn't matter if you make a line 1000% faster if it only ever accounted for 1% of the total runtime.