DEV Community

Discussion on: Simple and Clean Code vs. Performance

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

I agree. I've done a lot of optimizations, in places that really needed it, and some places that didn't. The first order of attack is always efficiency. Then you look at memory usage.

If that doesn't fix the issue, then you go get lunch, dinner, go on vacation, reevaluate life choices, then learn how to profile code. The learn how to research and make sure the efficiency part is right. Then read about memory and check if that is the best use.

When all else fails you resort to actual optimization.

Of course many optimizations are simple cleanups and can be done without too much thinking. But you'll only know that once you've learned how to profile and identify such issues.