3 ms·
I have the opposite opinion, people focus on Big O too much. Designing for Big O is like designing for scale. For some reason we can recognize that building a s
by qppo 6y ago
I have the opposite opinion, people focus on Big O too much. Designing for Big O is like designing for scale. For some reason we can recognize that building a system for a billion users doesn't make sense when you have a thousand... meanwhile we're out writing code with std::unordered_map instead of std::vector with fewer than a hundred elements in the table.
We need to make a bigger fuss out of the "C" in Big O, teach people how to use a profiler, and teach more about memory layout and how computers actually function - time complexity isn't time of execution. But too many people treat it like that.
- cmckn 6y agoDeciding if your code is a bottleneck is definitely important in deciding how much to worry about asymptotic behavior. But in a lot of cases, it's no more complicated to use a set instead of a list, for example. Totally agree though that benchmarking/profiling is the ultimate decider of what is fast.
- qppo 6y agoSorry if I was unclear, the point I wanted to make was that asymptotic behavior is not something you need to worry about because it's unlikely your program will behave asymptotically.