How to find the most time-consuming function?

BlitzMax Forums/BlitzMax Programming/How to find the most time-consuming function?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Bollocks. 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. Particularly with larger datasets, or many itterations. If an algorithm has linear time complexity (for example) on 100.000 objects run 100.000 times, it will still have linear time complexity on a 100 objects with 100 itterations, the time factor will just be smaller. The only worthwhile optimisation is to design an more elegant algorithm, with a lower degree of time complexity, namely logarithmic or constant.

In this light, the better test would be not to test the same function several thousands of times with the same input, but instead test it only once, with increasingly larger inputs. That way you can get a good picture about which factors contribute to slower code.

BlitzMax really could use a code profiler tho'.