O'Reilly logo

High Performance iOS Apps by Gaurav Vaish

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Network

With the necessity to use networking in an app and with limited choices for minimizing latency (e.g., using CDNs or edge servers or using smaller payload formats like Protobuf or data compressions), everything gets down to best utilizing the available network conditions and planning ahead for varying scenarios.

In this chapter, we look at the factors that impact the overall latency and how you can make best use of the information available to maximize performance.

Metrics and Measurement

Most of the work done in networking is outside of your control, so it is important to identify the metrics to measure. We will discuss some of the more important performance-related metrics in this chapter. Note that this is not intended to be a comprehensive list, but just to point out the more important ones to measure in relation to optimizing performance.

Figure 7-1 shows a bird’s-eye view of a typical request over the network.

hpia 0701
Figure 7-1. Network—device to server

The general structure of the discussions that follow is a description of the metric of concern, one or a couple of examples, followed by best practices.

DNS Lookup Time

The first step to initiating a connection is DNS lookup. If your app is network heavy, DNS lookup times can slow it down. In a rigorous statistical sample of two locations, DNS lookup time to the host www.google.com from Sunnyvale, California, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required