Bug #22158
closedReplace calls to t3lib_div:: within t3lib_div to self:: du to performance reasons
0%
Description
Currently t3lib_div uses t3lib_div:: to refere to itself statically.
Self:: is 8% to 10% faster than using classname:: due to the fact that no scope resolution has to be performed.
See:
http://svn.php.net/viewvc/php/php-src/branches/PHP_5_2/Zend/zend_API.c?view=markup
Line(2154 to 2164).
Minitest:
class Test {
public static function a() {
Test::c();
}
public static function b() {
self::c();
}
static function c() {
$a = 1;
}
}
$interation = 100000;
$timeStart = microtime();
for ($i = 1; $i <= $interation; $i++) {
Test::a();
}
$timeEnd = microtime();
$time = $timeEnd - $timeStart;
echo $time . ' seconds -> ' . $interation . 'x Test::c <br />';
$timeStart = microtime();
for ($i = 1; $i <= $interation; $i++) {
Test::b();
}
$timeEnd = microtime();
$time = $timeEnd - $timeStart;
echo $time . ' seconds -> ' . $interation . 'x self::c <br />';
?>
(issue imported from #M13611)
Files