Chapter 8. Performance

 

This chapter covers

  • Profiling Ajax applications
  • Managing memory footprints
  • Using design patterns for consistent performance
  • Handling browser-specific performance issues

In the previous three chapters, we have built up our understanding of how Ajax applications can be made robust and reliable—able to withstand real-life usage patterns and changes in requirements. Design patterns help us to keep our code organized, and the principle of separation of concerns keeps the coupling in our code low enough to allow us to respond quickly to changes without breaking things.

Of course, to make our application really useful, it also has to be able to function at a reasonable speed and without bringing the rest of our user’s computer to a grinding halt. So far, we’ve been operating in a high-tech Shangri-la in which our user’s workstations have infinite resources and web browsers know how to make use of them effectively. In this chapter, we’ll descend to the grubby side streets of the real world and look at the issue of performance. We’ll be taking our idealistic refactoring and design patterns with us. Even down here, they can provide a vocabulary—and valuable insights—into performance issues that we might encounter.

8.1. What is performance?

8.2. JavaScript execution speed

8.3. JavaScript memory footprint

8.4. Designing for performance

8.5. Summary

8.6. Resources