In the previous chapter, you learned how to use Instruments to measure your app's performance. Measuring performance is a vital skill in discovering slow code or memory leaks. You saw that sometimes it's easy to fix slow code and increase performance by fixing a small programming error. However, the fix isn't always that easy.
An example of code that is very hard to make fast is networking code. When you fetch data from the network, you do this asynchronously. If networking code was not asynchronous, the execution of your app would halt until the network request is finished. This means that your app would freeze for a couple of seconds if the network is slow.
Another example of relatively slow code is a data file from the app bundle and decoding the raw data into an image. For small images, this task shouldn't take as...