4 ms·
You may be starting from wrong assumptions. Asymptotic analysis of algorithms is useful when you want to extrapolate to larger datasets, since it helps you figu
by sqrt17 17y ago
You may be starting from wrong assumptions. Asymptotic analysis of algorithms is useful when you want to extrapolate to larger datasets, since it helps you figure out what, if the data grew enough, would become the bottleneck in your source code. A profiling tool is useful for getting at the actual time consumption. So what you'd want is to run your code under profiling, using a realistic amount of data. (Use a sampling profiler if the instrumented source code is too slow).
Anything that looks bad at the scale that you're aiming at is something that you'd (eventually want to address).
Another method would be to run the profiler twice, once on a small-ish dataset and once on a large-ish dataset (where large-ish doesn't have to be the full size) and then subtract the small-ish times (cumulative or self) from the large-ish times so you get rid of the startup time and see more clearly where the non-startup portion is spending its time.