I am profiling a PHP application (built upon the Zend framework). Attached you can find a screenshot of the main call graph that KCacheGrind produces from xDebug output.
There are two things that I don't understand:
1) Why does {main}
"fork" into 2 calls? Are they supposed to be parallel somehow or does one happen after the other?
2) The arrow to the left of {main}
has a little blue bar with the text 2x
; does this mean that the call to Zend_Application->bootstrap
happened twice?
When Xdebug is running, it will call back to your IDE (like PhpStorm or VS Code) from the server where it's running. Your IDE will sit and listen for that connection on a specific port (typically port 9000 or 9003).
Introduction # Xdebug's Profiler is a powerful tool that gives you the ability to analyse your PHP code and determine bottlenecks or generally see which parts of your code are slow and could use a speed boost.
Xdebug allows you to log all function calls, including parameters and return values to a file in different formats. Those so-called "function traces" can be a help for when you are new to an application or when you are trying to figure out what exactly is going on when your application is running.
The calls (of course) happen after each other. The graph splits because each of the top two functions are called by main(). The graph shows calls, not execution order.
Yes, that's exactly what it means. main() called Zend_Application->bootstrap twice and ->run once.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With