Managing Memory Mistakes
Performance, as it turns out, isn’t just about writing the most efficient algorithms for important tasks. Everything operates in a context, and in the mobile context, memory is perhaps the most important consideration.
You can, for example, trade memory for better performance. Consider a hypothetical piece of hardware on which trigonometric operations like sine and cosine are really slow—don’t worry, this is not an “asking for a friend” scenario, since iOS devices are pretty good in this department. If you were writing a game that used a lot of math, this slowness could hurt your entire application. One way you might deal with it would be to compute sines and cosines for every degree once, and then just put them in a ...
Get Xcode Treasures 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.