If you make an optimization that was not at a bottleneck, you did not make an optimization.
If you make an optimization that was not at a bottleneck, you did not make an optimization.
It doesn't matter how optimized your computations are if you're spending the whole time waiting in IO. And don't forget that the program is generally just a piece of a larger process.
Anyone want to share their main takeaways from these books?
This can become a tragedy of the commons in desktop and mobile apps, where you don't know how much memory the end user has or needs, but you do know you aren't paying for it.
This is absolutely not true. Just because you have enough memory does not mean that wasted memory couldn't be better used - e.g. for disk cache or to run more tasks.
In other words, all engineering is time- and cost-constrained. Anybody can build a good chair for $10,000 or a good PC for $100,000. Doesn't mean it's good engineering.
And some people can build a great PC for $1,000 that runs circles around the good PC for $100,000.
There's so much more to engineering than thinking in terms of time and cost constraints. Those are real constraints, but they're not the most important.
Engineering is design. If you have good design, good insight, you can do things that people with infinite time and budget could never dream to achieve. You can start making a product that's a hundred times more powerful for a tenth of the price in a fraction of the time. If you don't have good design, good insight, then no amount of time or budget can help you.
BE LOGICAL! Of course you first fix the big bottlenecks.
>good PC for $100,000. Doesn't mean it's good engineering.
Of course it is...or can you gold platter a pc case?
1. Adding the optimization didn’t make the code more complicated.
2. Adding the optimization didn’t introduce a bug.
3. This part of the code will be a bottleneck in the future. The time spent optimizing is a write-off if the project is canceled or that portion is replaced.