Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31811 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3197 invoked by uid 1010); 21 Aug 2007 19:43:24 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3182 invoked from network); 21 Aug 2007 19:43:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2007 19:43:24 -0000 Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:46094] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/31-29144-C504BC64 for ; Tue, 21 Aug 2007 15:43:24 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 980E2C0D15F; Tue, 21 Aug 2007 12:43:21 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-1-170.neb.res.rr.com [76.84.1.170]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 19D95C0D15E; Tue, 21 Aug 2007 12:43:20 -0700 (MST) Message-ID: <46CB40E8.7050602@chiaraquartet.net> Date: Tue, 21 Aug 2007 14:45:44 -0500 User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: Rasmus Lerdorf CC: internals Mailing List References: <46C9F217.8040804@chiaraquartet.net> <46C9F50A.7040009@sci.fi> <46CA6367.9090301@lerdorf.com> <46CA71F4.40205@chiaraquartet.net> <46CA75ED.8060506@lerdorf.com> <46CA7999.8020605@chiaraquartet.net> <46CA7CC5.3080803@lerdorf.com> In-Reply-To: <46CA7CC5.3080803@lerdorf.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] [PATCH] allowing multiple namespaces per file plus namespaces with brackets From: greg@chiaraquartet.net (Gregory Beaver) Rasmus Lerdorf wrote: > Well, outside of an opcode cache, you wouldn't care whether the logic is > in the compiler or the executor. But once you introduce an opcode > cache, anything that you can resolve at compile-time means one less > thing to do at execute time which means that the feature essentially > becomes free once the file has been compiled and cached. > > Current opcode caches, including APC, will replace class and function > definitions with NOPs in the cached op_arrays when it can definitively > resolve them at compile-time. Things like autoload and conditional > includes are examples of features that destroy this optimization because > we need the runtime context in order to determine what to do which means > we have to do it in the executor. Then of course there is the nightmare > of class inheritance spanning includes and code that sometimes includes > a file containing a child class conditionally and other times > unconditionally. That caused us weeks, if not months, of headache in > APC land. > Hi, I remember this anguish, and have been following closely APC development through Gopal's blog, watching commit messages and so on, and have been proposing changes to PEAR2 (admittedly extremely controversial ones) that would make it more APC-friendly, so the last thing I want to do is add headaches in APC land, quite the opposite. >> I don't wish to cause trouble on these points, but I don't yet >> understand how the patch makes things any worse for APC, as all of the >> namespacing is still 100% deterministic and is a closed per-file system >> done at compile-time. >> > > Perhaps it doesn't. What worries me is the ability to change the > namespace mid-file. Maybe I can resolve this entirely at compile-time > as long as no includes, imports or any other tricks can be used to break > the namespace-to-one-file association. And we especially have to avoid > anything that would cause a single file to change namespaces depending > on how it is included and where it is included from. I understand this. I guess the way I would answer this is to question how you think APC would react differently to these two examples: example 1: file1.php: another.php: file2.php: ==== example 2: file1.php: file2.php: The two are functionally equivalent ways of doing things, the first without my patch, and the second with it. Would the second example's file2.php cause greater difficulty for APC in your estimation? Greg