Optimization costs time & effort measured in programmers' work-hours.
Programmers are often paid for their time.
Optimized code is larger, harder to understand, harder to modify. So after optimization code is faster, better but also harder to modify. Modifications cost more of programmer's time, more stress, more errors, more delays, ...
Optimization should happen at end of Programming Effort. (after design, prototype, implementation at high level of abstraction, etc ...).
Premature Optimization is source of many problems.
see also, if You wish or need, ... : Optimization Triad.