Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31760 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45435 invoked by uid 1010); 21 Aug 2007 05:00:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 45419 invoked from network); 21 Aug 2007 05:00:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2007 05:00:28 -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:55911] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/90-36574-A617AC64 for ; Tue, 21 Aug 2007 01:00:27 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 976ECC0D315; Mon, 20 Aug 2007 22:00:23 -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 C5D7EC0D314; Mon, 20 Aug 2007 22:00:22 -0700 (MST) Message-ID: <46CA71F4.40205@chiaraquartet.net> Date: Tue, 21 Aug 2007 00:02: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> In-Reply-To: <46CA6367.9090301@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: > Sheez, guys, slow down a tad. Just because he says "no performance > penalty" in the description, doesn't make it true. Unless I missed > something in the patch, I don't see how I would resolve the symbols at > compile-time now which means it has been moved to the executor and in > doing so it implies a huge performance penalty. Hi Rasmus, I'm actually certain that the patch doesn't change any of the symbol resolution logic or add any need to move things from the compile-time to the executor. This is because the namespace implementation basically works more like a #define macro to auto-prepend class names and function names with namespace names. Old logic: request start => CG(namespace) = NULL T_NAMESPACE ...; zend_do_namespace() => defines CG(namespace) which is used for creating class and function entries php junk compile end => if (CG(namespace)) destruct CG(namespace), CG(namespace) = NULL New logic: request start => CG(namespace) = NULL [potential php junk] T_NAMESPACE ... { zend_do_namespace() => defines CG(namespace) which is used for creating class and function entries php junk } zend_do_end_namespace() => destruct CG(namespace), CG(namespace) = NULL php junk (which can include class/function entries, although that's a terrible idea) T_NAMESPACE ... { zend_do_namespace() => defines CG(namespace) which is used for creating class and function entries php junk } zend_do_end_namespace() => destruct CG(namespace), CG(namespace) = NULL compile end => if (CG(namespace)) destruct CG(namespace), CG(namespace) = NULL In other words, the only difference is that mid-parse the namespace #define-like prefix can be modified or removed. Greg