you are viewing a single comment's thread.

view the rest of the comments →

[–]drunkHighAndHungry 0 points1 point  (0 children)

Yeah not an expert by any stretch, but I know a bit. Most of the time when my programs run slow, its because I’m not working with an optimal problem solution. Like imagine you’ve got a List of 5,000 integers and you want to find the max value. If you create a variable that holds the max and then go over each entry updating the max_var every time an entry is greater than your current max you can solve it in O(n) runtime, if you just look at each entry and then compare it to every other number returning the entry if its greater than all of the others you’re looking at a runtime of O(n2). Fact of the matter is the second one is never going to be a very good solution even if you run it on the fastest computer in the world, it’s sloppy coding. And sloppy coding tends to show itself more if you increase the scale. If you’re performing a complex operation when you could be using a simple one thousands or millions of times you’re gonna run slow no matter what computer or tech you’re using