Hacker News new | ask | show | jobs
by gspr 98 days ago
> I have seen more benefit from it than harm.

Same. I, too, am sick of bloated code. But I use the quote as a reminder to myself: "look, the fact that you could spend the rest of the workday making this function run in linear instead of quadratic time doesn't mean you should – you have so many other tasks to tackle that it's better that you leave the suboptimal-but-obviously-correct implementation of this one little piece as-is for now, and return to it later if you need to".

2 comments

That is a great example of when the original quote works as intended.

I'm reacting to experiences where the software that emerges from a relatively large team effort can't really be made meaningfully faster because there are millions of tiny performance cuts - from the root to the fruit.

yes! See Rule 4

/* If we can cache this partial result, and guarantee that the cache stays coherent across updates, then average response time will converge on O(log N) instead of O(N). But first make the response pass all the unit tests today */