News for hackers. Stuff that matters.
Re:Zebras Hate You for No Reason: Why Amdahl's Law Is Mislea... by jacquesm on Sunday December 04, 2022 @02:28AM (#33851436)
That's why you profile. Software tends to get super complex as you add features and without a very thorough understanding of what is going on chances are that your program is doing something else than what you think it is doing, or at least that it is spending it's time on something else than what you think. By profiling you get a grip on that and this in turn allows you to spend your time on that 1% of the code where it spends 99% of the time. By the time you're done optimizing that a new bottle-neck will have arisen and so on. I've had software that was performing marginal end up being too fast to measure accurately over the course of a few iterations, and that's when I thought that I knew what was going on.

If Donald Knuth suffers from this as well then I wouldn't berate myself too much about it, his famous quote that 'premature optimization is the root of all evil' then you're more than excused to let optimization rest until the code is correct (which is far more important than that it is fast) and then use a profiler to tell you where to most efficiently apply your attention. This will get you to a very high percentage of the optimum in a relatively short time.

There are no comments on this comment yet.