O'Reilly logo

Web Performance Tuning, 2nd Edition by Patrick Killelea

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

Patterns of Performance Improvement

Performance improvements can be grouped into patterns of the way things tend to work rather than concrete advice. The following sections discuss some patterns that unify performance improvement techniques.

Amortization

Performance improvements often involve amortizing overhead among many transactions for an economy of scale:

  • HTTP 1.1 allows a single TCP connection to be reused for multiple file downloads. This feature is known as persistent connections. The overhead of setting up and tearing down a TCP connection is spread among several files rather than reincurred for each file.

  • Java .jar files work in a similar way, grouping Java .class files together into a package that can be downloaded in one TCP connection rather than setting up a separate TCP connection for each class. The downside here is that .jar files may include classes you never use.

  • A composite imagemap is another example. Rather than sending multiple small images to the user, send a single large image. If the original individual images were clickable, you can maintain the same functionality by making the large image a clickable imagemap.

Caching

Caching is the most important and widely used performance technique. The idea is simple: keep frequently accessed data close at hand. Caching helps only if some data is in fact more frequently accessed than other data, but this is usually the case.

  • You can often trade storage space for more performance by running the most popular inputs ...

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