3 ms·
I haven't had the chance to deal with big O issue in the frontend web apps where most operations are short and data set are small. For backend processing, loop
by ww520 15y ago
I haven't had the chance to deal with big O issue in the frontend web apps where most operations are short and data set are small. For backend processing, looping and large data processing are always considered with efficiency in mind.
The most memorable big O analysis that actually led to fixing a performance bug was when I wrote the caching layer of a file system using bubble sort for sorting the dirty blocks before flushing. It slowed down noticeably, like seconds of pause with 100% CPU, when the cache size exceeded 10K blocks. Replacing it with heap sort made the problem go away. O(nlogn) really is much more scalable than O(n^2).