[Get a better resolution image from here].

Update: New graph with timetrack comments: here

Today I did some performance tests on the TYPO3 core version 4.2 and the current trunk (4.3). I did this by creating a file index_debug.php with this content:

$GLOBALS['tick_logfile'] = fopen('tick_'.time().'.csv', 'a');  
$GLOBALS['tick_time'] =  microtime(true);  
$GLOBALS['tick_mem'] = memory_get_usage();  

fwrite($GLOBALS['tick_logfile'], 'Time [sec*10000], Memory [kbytes] '. "\n");  

function tick($str = '') {  
    fwrite(  
        $GLOBALS['tick_logfile'],   
        (round((microtime(true) - $GLOBALS['tick_time'])*10000)) . ',' . (round((memory_get_usage() - $GLOBALS['tick_mem']) / 1024)) . ',"' . $str . '"' . "\n"  
    );  
}  

register_tick_function('tick');  
declare(ticks = 100);  

include('index.php');  

fclose($GLOBALS['tick_logfile']);  

?>

This file executes the tick() function every 100 low level php functions. The function logs the current time and memory usage to a file. I run this test on a very basic TYPO3 instance. No plugins, only a single text with image content element a two line typoscript setup:

page = PAGE  
page.10 < styles.content.get

I ran the tests on a TYPO3 4.2 (blue lines) and on the current trunk version (green lines). Each with a backend user logged (solid line) in and not logged in (dashed line). Each with a filled cache and an empty cache. You'll see the results in the graph above.

The y axis shows the used memory in kbytes and the x axis shows the time in 10*ms ("1000" = 100 ms = 0.1 seconds; OpenOffice seems to have problems drawing XY-graphs with small values).

I could not notice any speed improvement in 4.3 between the cached and the non-cached version. Maybe there's something wrong here. But you'll see a remarkable difference between the non-cached version and the cached version in 4.2, which has delivered the content after 200ms. Being logged in as backend user doesn't make any difference in this case.

Then you can see the effect of the autoloader in place in 4.3. Especially when not being logged in in 4.3 there is a big gain in memory consumption and speed... I still haven't found out where the two kinks come from.

Calling the tick function manually at some special points passing a string as a parameter allows you to populate the data with some additional information. You could pass the tslabel passed to timetrack's push method to the tick function.

Comments

This website uses disqus for the commenting functionality. In order to protect your privacy comments are disabled by default.

Enable Comments