Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43896 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23388 invoked from network); 12 May 2009 08:43:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2009 08:43:35 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.185 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.185 il-mr1.zend.com Received: from [212.25.124.185] ([212.25.124.185:49550] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/A1-05302-6B6390A4 for ; Tue, 12 May 2009 04:43:35 -0400 Received: from il-gw1.zend.com (unknown [10.1.1.21]) by il-mr1.zend.com (Postfix) with ESMTP id 3BB885047F; Tue, 12 May 2009 12:41:02 +0300 (IDT) Received: from ws.home ([10.1.10.12]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 12 May 2009 11:43:34 +0300 Message-ID: <4A0936B0.8000802@zend.com> Date: Tue, 12 May 2009 12:43:28 +0400 User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Paul Biggar CC: Stanislav Malyshev , Guilherme Blanco , Marcus Boerger , Timm Friebe , internals@lists.php.net References: <155749706.20090117211737@marcus-boerger.de> <497872B8.60807@zend.com> <4A08CA5F.7010200@zend.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 12 May 2009 08:43:35.0139 (UTC) FILETIME=[BCA64B30:01C9D2DD] Subject: Re: [PHP-DEV] Method call improvements From: dmitry@zend.com (Dmitry Stogov) Paul Biggar wrote: > Hi Stas, Dmitry, > > On Tue, May 12, 2009 at 2:01 AM, Stanislav Malyshev wrote: >> IHMO it's not static enough. I.e., since PHP is not compiled, we can not >> create VD table for the class until runtime inheritance, which means that >> the code using this class can use method resolution more efficient than >> name->function, i.e. hashtable. These lookups can be cached (i.e. CV style) >> but I don't see how they can be altogether prevented. > > On Tue, May 12, 2009 at 7:25 AM, Dmitry Stogov wrote: >> The real things is even worse as during compilation of a class it's parent >> class doesn't have to be known. So construction of VMTs becomes a bit >> problematic. BTW we could think in this way... > > > Apologies, I'm not familiar with run-time inheritence in PHP. My > understanding was that when a classes source code is compiled, its > parent classes must be known. When is this not the case? The parent class may be defined in other file that is loaded at runtime using include() statement. It's very usual case. So the PHP first loads the include file and then declares child class at runtime. > Must it be known for the class' first instantiation? Of course. :) > In the worst case, it _might_ be cheaper to build it at instantiation > time, but I would have to look up how expensive that is in a more > static language to be sure. Certainly, it is currently so expensive > that almost anything else would be better (including the OP's patch). I don't see how run-time VMT contraction may help, because calls to virtual method must know VMT offset at compile-time. Thanks. Dmitry. > Thanks, > Paul > >