3 ms·
> There is a whole class of developer out there who rejects any optimization beyond occasional attention to asymptotic complexity. They believe that their resp
by amelius 12y ago
> There is a whole class of developer out there who rejects any optimization beyond occasional attention to asymptotic complexity. They believe that their responsibility ends once they’ve picked the theoretical best algorithm, and that at this point things are as good as they’re likely to get.
And there's also a whole class of developers that don't seem to care about asymptotic complexity. Take for example the React crowd: in React, in its rawest form, every little update to the DOM will require O(N) time to update the display, even though the update is usually fast because of the diffing algorithm. However, the O(N) complexity puts a strong limit on the maximum complexity of the DOM tree, and it is imprudent to just ignore that.
- pdpi 12y agoI strongly suspect you can't do much better than O(n) on the actual redraw of the DOM, so having an O(n) diff acting before isn't making the asymptotic behaviour any worse.