Re: switch labels in sub-blocks

From: Date: Sat, 29 May 2004 14:15:47 +0000
Subject: Re: switch labels in sub-blocks
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-10172@lists.php.net to get a copy of this message
> Well, now that I think I understand what is it for, > I'm pretty sure it's not very appropriate for PHP(, > unless someone will provides an example of the opposite > of course). > > It's kind of clarity vs efficiency. > The more the basic operation ("*to = *from++" in the > original) is getting bigger (slower) the efficiency gain becomes > smaller (correct?) so I would prefer clarity here. > > I'm not even sure real example in PHP will have close to 50% > speed gain. > In the case of "Duff's Device" it certainly isn't applicable to PHP....It much for efficient for the engine to process a complex single opcode than to process many simple opcodes in succession. That still doesn't speak to whether or not there aren't truly applicable examples. Functionally the parser doesn't want to see overlapping structures like this and it feel non-trivial to implement. But I havn't looked at the switch implementation close enough to be certain yet. For the sake of readability I'm -1. I'd sooner see goto implemented than this. And I don't care for that either. -Sara

« previous php.internals (#10172) next »