I'd like to find a way to determine how long each function in PHP, and each file in PHP is taking to run. I've got an old legacy PHP application that I'm trying to find the "rough spots" in and so I'd like to locate which routines and pages are taking a very long time to load, objectively.
Are there any pre-made tools that allow for this, or am I stuck using microtime, and building my own profiling framework?
I have actually done some optimisation work last week. XDebug is indeed the way to go.
Just enable it as an extension (for some reason it wouldn't work with ze_extension on my windows machine) , setup your php.ini with xdebug.profiler_enable_trigger=On and call your normal urls with XDEBUG_PROFILE=1 as either a get or a post variable to profile that very request. There's nothing easier!
Also, i can really reccommend webgrind , a webbased (php) google Summer Of Code project that can read and parse your debug output files!