TYPO3 BE profiling with XHProf profiling
Recenlty I had a performance problem related to use of some 3rd party extensions. As the tagert of the performance optimization was in the BE of TYPO3, existing profilers, available on TYPO3 repository were not useful, as they all oriented FE.
Works well. Very easy to install.
Easy to launch profiling. Just add a function in the beginnig of Your script.
The representation of statistics is not so deep, and takes too much time the result because of statistics analyzer pprofp, which is not compiled, just a script.
So, this tool is useful only for simple scripts profiling. I would not advice it to make TYPO3 BE profiling.
xdebug & zend_debugger in eclipse
Normally I use them with an adapter integrated in Eclipse, and it works well, but not this time.
xdebug is more complicated to install. zend_debugger looks a litte bit better, but You should register to get it first. And it’s not really open source, a binary.
In our infrastructure we uses some complex system of network mounts and symlinking, so it was too much complicated for xdebug and zend_debugger to make connection between the requested script and physical file. Maximum what I could get with latest Eclipse PDT and PHP5.3 : break on first line, but not all breakpoints of my need. Probably there is some way to get it work, I had not enough time for debugging this time.
Simple to use.
A little bit complicated to configure in the begining if You would like readable statistics.
There are lots of entry points in BE. In my case, the problem was in mod.php, so I used typo3/mod.php script.i
You should make a vhost for xhprof to get the interface : http://xhprof.local/
Include in the begining of the code :
$xhprofProjectKey = 'projectkey'; require_once "/path/xhprof_lib/utils/xhprof_lib.php"; require_once "/path/xhprof_lib/utils/xhprof_runs.php"; xhprof_enable();
Include in the end of the code :
$xhprof_data = xhprof_disable(); $xhprof_runs = new XHProfRuns_Default(); $run_id = $xhprof_runs->save_run($xhprof_data, $xhprofProjectKey); echo "XHProf results : http://xhprof.local/index.php?run=$run_id&source=$xhprofProjectKey";
Visit http://xhprof.local/ to check the results
Use graphviz to make maps. And You could use xhgui, which makes great interfaces for collected statistics.
It looks Ok now. I made profiling of several sites, modified 3rd party extension, and shared patches with ex