note 102780 added to control-structures.switch
| From: | rahbari at gmail dot com | Date: | Sun, 06 Mar 2011 09:37:51 +0000 |
| Subject: | note 102780 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-177588@lists.php.net to get a copy of this message | ||
I found out that the switch code is executed much like an if/else chain. I wonder why it's not
implemented as a jump table. I'm going to use this structure inside a tight loop and the jump
table would increase performance up to 40 times.
----
Server IP: 69.147.83.197
Probable Submitter: 76.164.193.82
----
Manual Page -- http://www.php.net/manual/en/control-structures.switch.php
Edit -- https://master.php.net/note/edit/102780
Del: integrated -- https://master.php.net/note/delete/102780/integrated
Del: useless -- https://master.php.net/note/delete/102780/useless
Del: bad code -- https://master.php.net/note/delete/102780/bad+code
Del: spam -- https://master.php.net/note/delete/102780/spam
Del: non-english -- https://master.php.net/note/delete/102780/non-english
Del: in docs -- https://master.php.net/note/delete/102780/in+docs
Del: other reasons-- https://master.php.net/note/delete/102780
Reject -- https://master.php.net/note/reject/102780
Search -- https://master.php.net/manage/user-notes.php