4 ms·
> figuring out the actual complexity is neither relevant nor an economic use of time The fix was replacing a nested loop with a map. Figuring out that this goe
by ndriscoll 1y ago
> figuring out the actual complexity is neither relevant nor an economic use of time
The fix was replacing a nested loop with a map. Figuring out that this goes from O(n^2) to O(n) (modulo details like bucket count) is immediate if you know what the words mean and understand enough to identify the problem and make the fix in the first place.
- sn9 1y agoYes that's the algorithmic complexity of the function they patched.