Live data from Hacker News

PHP Profiler to optimize & speed up your applications

github.com

1–10 of 24 posts

Re: PHP Profiler to optimize & speed up your applications

#5

Forgive me if this is a stupid question, but what's with the sleep functions between other function calls? EDIT: Should have clarified. I'm referring to the demo.

That's just the demo, so you get some numbers in the output (since it doesn't do anything otherwise).

Re: PHP Profiler to optimize & speed up your applications

#8
I have found Facebook's xhprof extension to be a a very useful extension for profiling also https://github.com/facebook/xhprof.

Unlike the one above, it doesn't require any code changes (it's a C-based PECL extension), and can easily be set up to be triggered via a parameter on the URL or to profile every nth page load (via a simple auto-prepend) for usage in production environments. It produces a full callgraph (using graphviz), you can drill down into the profile interactively, and you can record and compare profiles over time of the same page. It's also really quick and easy to setup and use.

There are of course other extensions that can do some profiling such as APD and XDebug, but xhprof is my personal favourite. I'm not sure I would ever be keen on confining my profiling to a PHP profiler written in PHP, although you do get some similar functionality from some frameworks such as debug mode in the Symfony framework.

Post reply on HN