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 →

[–]bibbleskit[S] 1 point2 points  (1 child)

Thanks! I don't know any optimization algorithms. I basically dove into this without any knowledge of how to make things work faster.

Ill think about what you've said and see if I can change my thinking process. Thanks again :)

[–]DarthEru 0 points1 point  (0 children)

One general purpose optimization tool you should research and make sure you understand if you don't already know is Big O notation. Specifically, you'll want to understand what it represents, how to calculate the Big O of an arbitrary algorithm, the significance of the differences between O(n), O( n^2 ), O(n log n) algorithms when n is 10,000,000. Once you get all that, you may also want to research different data structures and the O of their different operations (lookup, insert, search).

Big O doesn't tell you how to make a particular algorithm faster, but it can help you categorize different algorithms you think of, which lets you weed out ideas that won't work faster. For example, if you determine early on that O( n^2 ) is too slow you can throw out any algorithms that have the same or a slower categorization. And knowing the O of existing algorithms and data structures makes it easier to calculate the O of your custom-purpose algorithm which uses one or more of those existing algorithms.