Reputation: 29
I'm pretty new to php and absolutely new to profiling, so please forgive me if my question is a little bit "simple".
So enabled xdebug and downloaded Kcachegrid to begin profiling, read through what I could find. My problem is that I'd like to improve speed, but whenever I view my xdebug reports in Kcachegrid, the same script with the same hardware runs with a merely different execution time (form 1.1 to 1.9 sec). I'm executing it on localhost so that I do not have to deal with network speed.
i've read this pretty good article from John Lim http://phplens.com/lens/php-book/optimizing-debugging-php.php and in his article he's dealing with fix execution time. I don't know what I am doing wrong or how could i get fix times so I can see if I get actually better results.
Any advice would be appriciated, or any resource you have read and found useful on php profiling. Thanks for replies!
Upvotes: 0
Views: 133
Reputation: 175
xdebug is good but I found XHprof an extension written by Facebook for its production profiling works a lot better. It shows you the Wall times of all functions and the stack of the call and can drill down to many levels and see the wall time on each call. You can also compare and consolidate similar calls and compare them over a period of time. Have a look at the demo on XHprof and its a very simple extension to implement. Its a matter of enabling a header and footer and you are off to the races.
Cheers, Thusjanthan
Upvotes: 1