We used the PHP profiler to analyze the rendering of the the Wordpress 3.3 default installation homepage using the twenty-eleven theme. Below is the call graph generated by KCachegrind for Windows (click to enlarge):
What we can see here is:
The script has a considerable long initialisation sequence: 124 ms, most of it spent compiling the PHP files included from wp-settings.php (they are not shown on this graph as it would take too much space, but they can be explored in the trace file, using KCachegrind's "callees" tab on wp-settings.php). The trimming of these nodes from the execution graph is configurably done by KCachegrind, not by the PHP profiler.
Therefore, we can assume that using a bytecode cache (like APC) would drastically improve the script's execution time
The templates load each other through the locate_template function, which is thus called recursively. The PHP profiler correctly decouples the recursive calls so that everything looks like a linear sequence of events.
The naming convention is confusing: wp-blog-header.php would be better called wp-do-everything.php, wp-settings.php would be much better off as wp-load-everything.php and locate_template could benefit from a name change to locate_and_load_template
You can download the php trace here to play with it in KCachegrind. (You may have to copy this and paste in a local file if your browser opens this as text)
Your privacy is important to us! Our website uses cookies, for which we need your consent. Please review here our personal data handling and cookie policy.