Skip to Content
Professional Website Performance: Optimizing the Front-End and Back-End
book

Professional Website Performance: Optimizing the Front-End and Back-End

by Peter Smith
November 2012
Intermediate to advanced content levelIntermediate to advanced
480 pages
14h 6m
English
Wrox
Content preview from Professional Website Performance: Optimizing the Front-End and Back-End

Chapter 12

Optimizing PHP

WHAT’S IN THIS CHAPTER?

  • Using opcode caching to speed up execution
  • Handling PHP sessions
  • Profiling bottlenecks with xhprof
  • Optimizing your PHP code

With so many different programming languages and development frameworks in use on the modern web, it would be impossible to even attempt to do them justice trying to completely cover them in a single book. Since PHP has easily become the most popular web scripting language in UNIX/Linux environments, it’s worth delving a bit deeper into how the language affects performance.

The downside to the popularity of back-end scripting is, of course, higher performance overheads. Although PHP scripts are typically fairly lightweight, they are still a lot slower to serve up than static HTML documents. In the case of heavier scripts, there can be a significant performance hit — both for the client (in the form of higher latency in requests), and for the server (in the form of higher resource usage, and a lower limit on the number of concurrent requests). In this chapter, you learn about a variety of ways in which PHP performance can be improved, both in how the operating system executes it, and in the language itself.

This chapter starts with a look at PHP modules and extensions — how too many extensions can adversely affect performance, as well as situations in which it can be worth writing your own. After that, you learn about opcode caching, a powerful technique that can overcome many of the limitations of an interpreted ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Front-end Performance

Front-end Performance

Bruno Skvorc, Craig Buckler, Maria Antonietta Perna, Ivan Curic
Back-end Performance

Back-end Performance

Bruno Skvorc, Christopher Pitt, Tonino Jankov, Reza Lavaryan, Daniel Berman

Publisher Resources

ISBN: 9781118551721Purchase book