Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Remember the context here. The idea is "premature optimization is evil". A lot of people often abuse the quote and then conclude "Caring about performance is bad" which is a complete non-sequiter and not the originally intended meaning of the quote.

The reason premature optimization is evil is that it consumes a lot of time and makes the coder more difficult to read and reason about.

If there's no clear benefit to this, then all the work done to optimize it resulted in _negative_ value. There was no gain, only time wasting and more complicated code.

An example of where performance doesn't matter: a piece of code is only executed once every 10 seconds and it finishes executing in 5ms. Spending time to reduce its execution time to 1ms does not produce any tangible benefits.

An example of where performance does matter: a piece of code is running all the time and it takes 500ms. If you can reduce it to 20ms, it's totally worth it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: