| It depends. Run the lifetime cost of a CPU, and compare it to what you pay your engineers. It's shocking how much RAM and CPU you can get for the price of an hour of engineer time. And that's not even all! Next time someone reads the code, if it's "clever" (but much much faster) then that's more human time spent. And if it has a bug because it sacrificed some simplicity? That's human hours or days. And that's not even all. There's the opportunity cost of that engineer. They cost $100 an hour. They could spend an hour optimizing $50 worth of computer resources, or they could implement 0.1% of a feature that unlocks a million dollar deal. Then having them optimize is not just a $50 loss, it's a $900 opportunity cost. But yeah, shipped software like shrinkwrapped or JS running on client browsers, that's just having someone else pay for it. (which, for the company, has even less cost) But on the server side: yes, in most cases it's cheaper to get another server than to make the software twice as fast. Not always. But don't prematurely optimize. Run the numbers. One thing where it really does matter is when it'll run on battery power. Performance equals battery time. You can't just buy another CPU for that. |
yet piles and piles of abstractions are considered acceptable and even desirable while having significant negative effects on code readability.