Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42704 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76700 invoked from network); 19 Jan 2009 12:06:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2009 12:06:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:36145] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/74-50097-5DC64794 for ; Mon, 19 Jan 2009 07:06:46 -0500 Received: from MBOERGER-ZRH.corp.google.com (p5086450E.dip.t-dialin.net [80.134.69.14]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 5836D11F293; Mon, 19 Jan 2009 13:06:42 +0100 (CET) Date: Mon, 19 Jan 2009 13:06:41 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1534507524.20090119130641@marcus-boerger.de> To: Stanislav Malyshev CC: Timm Friebe , internals@lists.php.net In-Reply-To: <4974440E.3060402@zend.com> References: <155749706.20090117211737@marcus-boerger.de> <4974440E.3060402@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Method call improvements From: helly@php.net (Marcus Boerger) Hello Stanislav, Monday, January 19, 2009, 10:12:46 AM, you wrote: > Hi! >> Aren't we able to bind these at least partially to the function call >> opcode, in case we know they are constant? If all is constsnt we could >> even store the whole lookup in the opcode. Well you'd have to convince >> Zend to do that because os far they have always been against this >> approach. > Err, I'm not sure how can you store in opcode something you don't know - > since opcode may be generated well before class or method exists, not > speaking about the object of which you know nothing at the time of > opcode generation? Same opcode could call entirely different methods of > different classes. Am I missing somehing? Nope. But sometimes we are in a scope where it is always the same thing we call. Or at leats a one of the three things are constant. And any of them being constant would help. >> Also the zend_class_enty lookup in [1c] imo is completely useless. If >> the zval object would store the class entry and the class entry had a >> pointer to the handlers then we would save another costly lookup and >> simply follow a pointer instead. > having only one handler table per class would make objects less flexible. How so? Tell me any case where that is different right now? Right now every member of a class tree (each class derived from a specific base class) has the same handler table. And that cannot be changed becasue each of the class members have the same creation/destruction c functions. The way to change that would be to have several creation functions that create objects with the same class that have different handlers. While that works at this level, we would end up in problems where we copy members of these classes or perform other complex operations. Unfortunately we often assume that same objects have the same handlers. And last but not least we already have some code that checks for handlers rather than for classes. Just because it is faster. My idea would in these cases add one more pointer indirection but change the other way to simply pointer resolving. Thus my idea would overall increase PHP speed. > -- > Stanislav Malyshev, Zend Software Architect > stas@zend.com http://www.zend.com/ > (408)253-8829 MSN: stas@zend.com Best regards, Marcus