Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10173 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98960 invoked by uid 1010); 29 May 2004 15:13:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 98913 invoked from network); 29 May 2004 15:13:02 -0000 Received: from unknown (HELO smtp2.actcom.co.il) (192.114.47.35) by pb1.pair.com with SMTP; 29 May 2004 15:13:02 -0000 Received: from [192.168.80.34] (line106-24.adsl.actcom.co.il [192.117.106.24]) by smtp2.actcom.co.il (8.12.8/8.12.8) with ESMTP id i4TFCvJC015971 for ; Sat, 29 May 2004 18:13:00 +0300 Message-ID: <40B8A953.4050608@actcom.net.il> Date: Sat, 29 May 2004 18:16:35 +0300 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040519 X-Accept-Language: en-gb, en-us, en, he, ru MIME-Version: 1.0 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> <20040529141411.11566.qmail@pb1.pair.com> In-Reply-To: <20040529141411.11566.qmail@pb1.pair.com> X-Enigmail-Version: 0.84.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] switch labels in sub-blocks From: ilya79@actcom.net.il (Ilya Sher) Sara Golemon wrote: >>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 That was my guess, you approved it. >....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. It looks like it worked just fine for that example in _C_. > > 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. Agreed on that. That's what I was originally talking about. It was phrased as "messy". > I'd sooner see goto implemented than > this. And I don't care for that either. > > -Sara >