Hey, anyone know how to easily profile PHP code? I've just now for the first time been able to get a semi-realistic speed comparison between my weblog running under my CMS and my "legacy" weblog code. My CMS code seems to be about 30-40% slower. I expected some slowdown, of course, since my CMS is doing more in the background. Plus, it's totally not optimized and some parts of it are still hacked together - so I'm including modules I won't have to when the CMS is done, etc. But I took a larger hit than I expected and I'd like to see where my code is spending the most time so I understand what's going on.
Here's one article: http://www.onlamp.com/pub/a/php/2002/02/28/profilingphp.html
Oh man do I want this: http://pear.php.net/manual/en/pecl.apd.php
Here's the page for the PEAR Benchmark package featured in the above O'Reilly article.
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):