Principle3 min
Premature optimization is the root of all evil
optimize when the profiler tells you, not when your ego does.
Optimize when the profiler tells you to, not when your ego does. Most 'performance issues' in early builds are actually architecture issues wearing a costume.
Correct, readable, and slow-enough beats fast, clever, and unmaintainable — every time. A 200ms query you can understand is worth more than a 20ms query nobody can touch.
Measure first, then optimize the thing that matters. Premature optimization is how you end up with a cache invalidation bug at 2am and no one to blame but a clever idea.when the profiler tells you
the point is simple — the details are not.
further reading3 references
- ↳Knuth — Structured Programming with go to Statements (1974)
- ↳Why Programmers are Delusional about Performance — slrpnk.net
- ↳High Performance Browser Networking — Ilya Grigorik