Hacker News new | ask | show | jobs
by jmull 2308 days ago
I think premature optimization remains as bad as always.

But you design for performance. The proper time to address it is at design time. That's not premature, that's the right moment.

I wish we could reserve the word "optimization" for the kinds of things you can do after implementation to improve the performance without significantly changing the design.

That is, let's continue to optimize last, but not try to make the word optimize mean address performance in general. That's not what the word means, after all.

3 comments

It's pretty easy do completely misjudge the real world bottlenecks when still in the design phase. Can often lead to adding complexity to the design to alleviate a guessed performance problem. Making it harder to then later fix the team problems...
I think the original piece makes a strong case that this isn't as true as we all think it is.

If you have a strong enough understanding of both the technology and the problem space, you really can judge the most likely bottlenecks as part of the design phase. Which can lead to radically different and better software.

You can always inform the design phase with some quick working prototypes that help validate some of the technical assumptions you are making.

Optimisation is redesign. I’m doing a video editor and have to transition to an Actor based asynchronous design if I want the user experience to be fluid. Leaving optimisation for later is not possible.
premature optimization is bad since it is a tautology.

but does it ever happen? =)

Best to call it unneeded optimization then, not premature.
I don't think you mean tautology.
I definitely do, but maybe I am wrong! If the optimization wasn't bad, it wouldn't have been premature.
I see. Well, when I said it was as bad as always, I was referencing the quote, "Premature optimization is the root of all evil." I take that has hyperbole, but the point isn't that premature optimization is bad. (So I think I get what you mean: premature includes the idea of being bad. It's one way of being bad. So in a sense "premature optimization is bad" means "a bad kind of optimization is bad". The point is premature optimization is particularly to be avoided. Treating it as a tautology misses the main point.

Suppose you're a snake charmer talking to an old-timer and the old-timer says, "The venomous king cobra is venomous." That's just a tautology. But if the old-timer says, "The venomous king cobra is the most venomous snake you'll ever handle and a single bite can kill an elephant," then hopefully you don't get stuck on the tautology and can see the important, actionable warning in there.