Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10172 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11686 invoked by uid 1010); 29 May 2004 14:14:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 11567 invoked by uid 1007); 29 May 2004 14:14:11 -0000 Message-ID: <20040529141411.11566.qmail@pb1.pair.com> To: internals@lists.php.net References: <40B76426.8080107@php.net> <40B7A984.6070702@actcom.net.il> <40B7B4EB.4080208@php.net> <40B82E44.2000409@actcom.net.il> <40B843DA.3080403@leetspeak.org> <40B85C1B.6010305@actcom.net.il> Date: Sat, 29 May 2004 07:15:47 -0700 Lines: 28 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Posted-By: 64.142.6.231 Subject: Re: [PHP-DEV] switch labels in sub-blocks From: pollita@php.net ("Sara Golemon") > 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