Michael Long
1 min readAug 6, 2023

--

The lens through much of what I write is mobile, iOS tp be specific. Performance (speed/cores) increases each and every year, and as such the hardware aspect is largely moot. We have roughly a five year window we're concerned about before devices go "obsolete" and fall off the bottom of the performance curve.

More to the point, and as I mentioned out in the original comment, the amount of work done interpreting a machine learning model, or making an API call, or mapping a network API result to an internal data model, or even just rendering an animation and screen redraw is much, much, much more than that incurred by layering an architecture and making an extra dozen method dispatch calls as a result.

Further, modern processors and compilers are pretty good at optimizing and inlining code where needed. The "extra" method call made to increase readability might well be optimized away in the final code.

One of my primary rules lies in trying to avoid premature optimization. Write good, clean, well-designed code, and then benchmark it and fix bottlenecks if/when they appear.

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

No responses yet