We all know Zend Optimizer This tool is Zend provides a free PHP acceleration software, the official said that this tool can make PHP performance improvement of 30%-40%, I recently personally tried, the Zend optimizer specifically done a test, Discovery can actually improve PHP efficiency. Here is the whole process of testing.
The PHP script used in the test is as follows:
?
To get the current time before the loop starts
$pagestartime =microtime ();
Here we start a loop, just do a simple self increment operation.
$k = 1;
For ($i =1 $i <1000000; $i + +) {
$k + +;
}
At the end of the loop, get the current time
$pageendtime =microtime ();
Calculate the time used for recycling
$starttime =explode ("", $pagestartime);
$endtime =explode ("", $pageendtime);
$totaltime = $endtime [0]-$starttime [0]+ $endtime [1]-$starttime [1];
$timecost =sprintf ("%s", $totaltime);
Print out when to recycle
echo "Times: $timecost";
?>
Test One:
Use Access in the browser, respectively, when Zend Optimizer is enabled and closed: http://localhost/test_zend_opt.php
Enable Zend Optimizer, the execution time for this script is: times:0.117239952087
Close Zend Optimizer, the execution time of the script is: times:0.129501104355
Come to the conclusion that:
When the PHP script is executed, the performance is increased by 9.47% after enabling Zend Optimizer