Optimizing Applications

Several general principals apply to optimizing applications. The first and most important principal is not to optimize prematurely. Another important principal is that most applications spend 80% of the their time executing only 20% of the code. When optimizing an application, it is important to concentrate on optimizations that will have a noticeable affect on performance. Optimizing the 80% of the program that consumes 10% of the execution time has no noticeable affect on performance.

Premature Optimization

The famous computer scientist Donald Knuth is quoted in nearly every book that describes optimizations. He said, “Premature optimization is the root of all evil.” There are many reasons to avoid optimizing at all. ...

Get Cocoa® Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.