Quote:
Originally Posted by
pandeesh
So how we can measure the performance of a script in general?
Big O notation does not in itself provide you with any useful performance information; it's merely one characteristic of an algorithm's complexity.
O(n) is usually better than O(n^2), but if you're working on a small data set and the O(n) approach requires some expensive setup to begin, the O(n^2) solution could be the better choice.
In the end, you need to test the code with what will be a typical workload, under typical operating conditions, on typical hardware.
Regards,
Alister