Chapter 17

Bandwidth and Performance Optimizations

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • Shrinking the size of the assets of your app
  • Optimizing performance of your JavaScript
  • Writing efficient code

In a decade where broadband is now the norm, many web developers have allowed their sites and applications to be composed of ill-formed HTML, massive JavaScript libraries, and multiple CSS style sheets.

However, when you are developing applications for iPhone, iPad, and iPod touch, you need to refocus your programming and development efforts toward optimization and efficiency. What makes developing IOS apps different from normal web apps is that the developer can no longer rely on the fact that the user is accessing the application from a broadband connection. iPhone and iPad users may be coming to your application using Wi-Fi or a slower 3G connection.

Therefore, as you develop your applications, you should formulate an optimization strategy that makes the most sense for your context. You need to think about both bandwidth and code performance optimizations.

OPTIMIZATION STRATEGIES

If you spend much time at all researching optimization strategy and techniques, you quickly discover that there are two main schools of thought. I refer to the first camp as hyper-optimizers. Hyper-optimizers do almost anything to save a byte or an unneeded call to the web server. They are far more concerned with saving milliseconds than they are about the readability of the code that they are optimizing. ...

Get Beginning iOS Application Development with HTML and JavaScript® 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.