I suggest putting a counter in your functions so you get an idea of how often they are being called.
"A more elegant algorithm (ie. one with a lower degree of time complexity) will always be more effective than one with a higher degree of time complexity."
Not true. Take, for example, the quicksort vs insertion sort. On large disorganised databases the quicksort wins hands down.
However, the recursive function calls are time consuming. With just a few elements the insertion sort will be a lot faster since the time complexity isn't slowing it down yet. Optimised quicksorts sort down to small groups then use another algorithm to sort the small groups out.
Also, the insertion sort has much better time complexity on mostly sorted data. If it sorts something in a game loop then it may already be mostly ordered from the previous frame and the insertion sort will be faster.
"A more elegant algorithm (ie. one with a lower degree of time complexity) will always be more effective than one with a higher degree of time complexity."
Not true. Take, for example, the quicksort vs insertion sort. On large disorganised databases the quicksort wins hands down.
However, the recursive function calls are time consuming. With just a few elements the insertion sort will be a lot faster since the time complexity isn't slowing it down yet. Optimised quicksorts sort down to small groups then use another algorithm to sort the small groups out.
Also, the insertion sort has much better time complexity on mostly sorted data. If it sorts something in a game loop then it may already be mostly ordered from the previous frame and the insertion sort will be faster.