|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-01-16 07:38 UTC] lisachenko dot it at gmail dot com
Description:
------------
I notice, that speed of method invocation for PHP5.5.0alpha3 is significantly slower than for PHP5.4 when running the script with internal Development Server. However, for CLI-mode PHP5.5.0 is faster than PHP5.4.10, as expected.
To reproduce the issue, please start the development server and execute test script in the browser.
Test script:
---------------
class TestPerformance {
public function speed()
{
$time = microtime(true);
$this->nop();
echo 'Took ', sprintf("%0.3fms to call method", (microtime(true) - $time) * 1e3);
}
protected function nop() {}
}
$instance = new TestPerformance;
$instance->speed();
Expected result:
----------------
Expecting that method invocation will take microseconds to finish:
php-5.4.10-Win32-VC9-x86:
Took 0.005ms to call method
php-5.5.0alpha3-Win32-VC9-x86:
Took 0.00Xms to call method
Actual result:
--------------
Method invocation for 5.5.0alpha3 took millisecond to finish:
php-5.4.10-Win32-VC9-x86:
Took 0.005ms to call method
php-5.5.0alpha3-Win32-VC9-x86:
Took 1.008ms to call method
php-5.5.0alpha3-nts-Win32-VC9-x86:
Took 1.000ms to call method
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 19:00:02 2025 UTC |
How about change to this: class TestPerformance { public function speed() { $time = microtime(true); $this->nop(); $end = microtime(true); echo 'Took ', sprintf("%0.3fms to call method", ($end - $time) * 1e3); } protected function nop() {} } $instance = new TestPerformance; $instance->speed();