Recent posts

Advanced mail subscription

The CMS TYPO3 extension repository already offers a few plugins that can...
09 January 2012

Convenient In/Out animation using expressions

We recently had an opportunity to make a set of instructional animations...
16 December 2012

Nginx boost extension

Introduction  The Evo_nginx_boost plugin allows us to cache pages...
14 December 2011

Tags

TYPO3 code profiling using XHProf

By: Bartosz Aninowski, 09 February 2010 Comments: 5 Tagi: facebook, XHProf

XHProf is a PHP code profiler developed by the programmers behind Facebook. More experienced TYPO3 CMS developers surely had many opportunities to make use of the capabilities it provides.

For example, we can no longer imagine efficient work and fast debugging of applications without TYPO3. If you are still using the admPanel (a tool built right in TYPO3) to check which part of the page takes too long to generate, it’s high time to check out XHProf and see for yourself how much valuable data it can

XHProf provides its users with a plethora of interesting data, including, among others:

  1. number of calls to each function
  2. calls of each function
  3. memory usage

Everything can be viewed upon each page refresh, and you get two views to choose from:

Flat profile

Hierarchical profile

XHProf result table

Hierarchical profile

Furthermore, XHProf provides the ability to compare data from various calls. For example, we can compare changes before and after making a change in the critical part of the code, to check how they influenced the performance.

Not so long ago, we had a problem generation times being too long when the page contained images. When we installed XProf, it turned out that PHP spends too much time on directory and file access functions. This was caused by a gross overpopulation of a certain image file directory - there were over 150,000 images in that one place.

This description is just an introduction to the many ways in which XHProf can be used. If you want to know more, read the official documentation at mirror.facebook.net/facebook/xhprof/doc.html

I also recommend a look at the full-size Hierarchical profile http://techblog.evo.pl/wp-content/uploads/2010/02/callgraph.png. The chart shows a cached page with one USER_INT object. A database is used as a cache backend.

Gravatar: cycu cycu, 29.05.2010 01:29
Śmieszne... Blog o typo3, a postawiony na Wordpressie...
Gravatar: bart bart, 29.05.2010 17:09
rozwin co Cie tak smieszy?
Gravatar: maholtz maholtz, 22.07.2011 11:33
You don't have permission to access /fileadmin/_temp_/callgraph.png on this server.

_temp_ is secured via .htaccess in TYPO3 by default, perhaps you can put the image directly in fileadmin?

thanks,
martin
Gravatar: maholtz maholtz, 22.07.2011 11:34
ok, perhaps just change the link to callgraph.png to:
http://techblog.evo.pl/wp-cont...
Gravatar: Bartosz Aninowski Bartosz Aninowski, 22.07.2011 11:57
maholtz thanks for info. Fixed.
Add comment

* - required field