What Makes Code Suboptimal?
In order to improve our code, we have to know the things that will slow it down, bloat it, or degrade its performance. Later on, this will help us to determine some code optimization techniques. At this stage, it’s helpful to appreciate what we’re fighting against.
- Complexity
Unnecessary complexity is a killer. The more work there is to do, the more slowly the code will run. Reducing the amount of work or breaking it up into a different set of simpler, faster tasks can greatly enhance performance.
- Indirection
This is touted as the solution to all known programming problems, summarized by the infamous programmer maxim: Every problem can be solved by an extra level of indirection. But indirection is also blamed for a lot ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access