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!