note 64773 deleted from language.control-structures by bjori
| From: | bjori@php.net | Date: | Thu, 20 Apr 2006 13:31:36 +0000 |
| Subject: | note 64773 deleted from language.control-structures by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-108810@lists.php.net to get a copy of this message | ||
Note Submitter: red at iklanumum dot com
Reason: useless
----
This is very unique!
First structure:
if ($a)
{}
else
{
only do this
}
The above structure does executed 12.77% faster than the second structure below! I had loop it 20
millions time and I got this unique result.
Second structure:
if (!$a)
{
only do this
}
By considering this fact then my programming-script will be written awful if I want to do "only
do this".
For "CODE CLEANLINESS" and logic purpose I shall use the second structure BUT for
"SPEED" purpose I better use the first one.
Although the different is not significant (will be differ about 3 seconds after 20 millions loop)
but I hope PHP developers take time to review how PHP parse (handle) this kind of structure. Well,
I'm not sure this could be happened in C++ or others too. But since I mostly use PHP then this
becomes my concern.
I wonder what people think about my script if they see that I use the former.
I worship the speed above all :)