Visualization Profiler for PHP with "full backtrace rendering"?

I am currently using xdebug profiler and KCacheGrind . But the GallGrind format does not store the full trace of the call, but only the parent child calls (see Kcachegrind / callgrind for inaccurate dispatcher functions? What I'm talking about.)

Is there a render profiler with full backtrace render available for PHP?

I looked

+6
source share
2 answers

I had to make some basic PHP profiles for a previous project a few months ago.

The best option I could find is facebook xhprof with xhprof-UI .

Learn how to install both of them here:

http://blog.preinheimer.com/index.php?/archives/355-A-GUI-for-XHProf.html

Some pros:

  • easy to use interface
  • Database backend to save previous profiling session
  • nice callgraphs
+3
source

If you just want to see the profiler output, this is one thing. If you are trying to optimize your code, do not forget about this method . I know you can do this in xdebug.

This is based on a very simple idea. Suppose your program does more than you need, so you can speed it up. In fact, suppose that for argumentation it does 9 times more than necessary, so if it were to take 1 second, it actually takes 10. These 9 seconds of unnecessary work may or may not be thoroughly mixed, like sugar and flour .

OK, in these 10 seconds you just press ^ C to stop it, and then carefully look at what it is doing at that moment.

What is the likelihood that you caught him doing a wasteful thing? In fact, it is very unlikely that you did not catch him doing a wasteful thing.

If you are not sure, just repeat.

Waste should not be so large. In fact, if you continue to pause as soon as you see that he does something more than once, if this is something that you can get rid of, you will get good acceleration guaranteed.

For example, if you pause it 5 times, and you see that he is doing something that he really does not need to do in 2 of these cases, how much could you save? You donโ€™t know for sure, but it will be somewhere around 40%. It may be only 20%. It can be as easy as 60%. So you donโ€™t know how much it will save, but you donโ€™t throw out the gold nugget just because you donโ€™t know how much it weighs.

Finally, there is no problem with which the profiler can find that this will not happen. The converse is not true.

+1
source

Source: https://habr.com/ru/post/905660/


All Articles