RE: [PHP] The "goto" discussion on the Internals List
| From: | Jay Blanchard | Date: | Tue, 07 Jun 2005 18:42:29 +0000 |
| Subject: | RE: [PHP] The "goto" discussion on the Internals List | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-216580@lists.php.net to get a copy of this message | ||
[snip]
A more realistic speed hit is the fact that using if/elseif/else or
switch statements requires on average an O( n ) lookup, whereas a proper
goto implemention is O( 1 ). Now I'll give you you could do an label to
function map and use that instead, but that's still O( lg n ).
[/snip]
Ah the good old days, when calculating clock cycles was done more than
punching cards. (Fortran flashback!)