August 22nd 2013 in Magento
Built by facebook, XHProf is a “function-level hierarchical profiler for PHP and has a simple HTML based user interface”. With Magento being a very big platform with a lot going on, it is often useful to determine where time is being spent. Of course there are fantastic tools like NewRelic, however if you are not willing to pay, or you are on a shared server, then XHProf does the job.
Fortunately, there is already a good Magento module available for XHProf available at https://github.com/liip/magento-xhprof. Liip provide a fairly solid integration of XHProf into the Magento admin panel, the only thing left to be desired is perhaps a better graphical user interface. It shows a break down of time spent in each method allowing you to diagnose why a given request is taking so long.
Recently I used this and discovered that I had not configured sendmail correctly!
EDIT: I’ve posted a follow up post on how to install XHProf and set it up with Magento.