ID: 28642
Comment by: abhishek_1dec at yahoo dot com
Reported By: am at andremeyer dot name
Status: Open
Bug Type: Performance problem
Operating System: Windows XP
PHP Version: 5.0.0RC2
New Comment:
hai i am abhishek pandey a php programmer there
i want a good job for this side
what can i do for it
Previous Comments:
------------------------------------------------------------------------
[2004-12-23 09:11:21] abhishek_1dec at yahoo dot com
kdghdf
gfh
fdhgfh
fghg
fhgf
hgfh
gfh
gfh
------------------------------------------------------------------------
[2004-06-05 16:05:23] am at andremeyer dot name
Description:
------------
Disabling assertions in PHP does not affect performance. After testing
my software with assertions, I want to disable assertions. I do this
with
ini_set('assert.active', false);
Surprisingly, the assert() statements in my software _still_ consume a
considerable amount of time.
Reproduce code:
---------------
<?php
$doAsserts = array(true, false);
foreach ($doAsserts as $doAssert)
{
ini_set('assert.active', $doAssert); // Turn assertions
on/off
$startTime = microtime(true);
for ($i = 0; $i < 1000000; $i++)
assert(is_numeric($i));
$endTime = microtime(1);
$time = $endTime - $startTime;
print "Elapsed time: $time\r\n";
}
?>
Expected result:
----------------
I expect something like:
Elapsed time: 1.3514750003815 // assertions turned on
Elapsed time: 0.4243453254354 // assertions turned off
I expect the elapsed time to decrease when turning assertions off.
Actual result:
--------------
Elapsed time: 1.3480539321899 // assertions turned on
Elapsed time: 1.3210921287537 // assertions turned off
As you can see, when turning assertions off, the elapsed time is nearly
the same. So I have to comment all my assertions in order to achieve a
better peformance.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28642&edit=1