A Simple and Effective PHP profiler: xhprof

Recently, the team that I’m involved with has started to look into incorporating some level of profiling into our workflow. To that end we looked a variety of tools including xdebug, Pear’s profiling package, xhprof, and ADP. We ended up settling on xhprof. This tool was conceived by Facebook for their own needs and eventually open sourced (lucky us!).


Setup and install is fairly simple. I highly recommend Lorenzo Alberton’s blog on the subject. The great thing about xhprof, and the reason we chose it over the others is that it’s lightweight, fast, and very detailed. The gui that it comes with definitely won’t win any design awards anytime soon. However, the information is all there and everything simply works.

Initially, the engineers on our team will begin to incorporate xhprof into their daily workflow to get baseline measurements which we then compare against measurements taken after a piece of code is refactored or a feature is added. We plan to discuss our experiences during code reviews on a weekly basis and perhaps at some point establish some company wide best practices (if any) regarding code profiling.

If we learn anything of note during our time with xhprof, I’ll be sure to post a follow-up article!

About these ads

1 Comment »

  1. malvikiran said

    Reblogged this on Simple PHP Blog.

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: