Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36168 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91437 invoked from network); 17 Mar 2008 12:23:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Mar 2008 12:23:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:14981] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/A5-62762-8C26ED74 for ; Mon, 17 Mar 2008 07:23:38 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 17 Mar 2008 14:23:54 +0200 Message-ID: <06B0D32C7A96544490D18AF653D6BDE502759A5A@il-ex1.zend.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] Patch for opcode caches Thread-Index: AciGAdz0ykjod3GsQJWDcZ4ZsLpiXACJdBGQ To: "Marcus Boerger" , "Stas Malyshev" Cc: Subject: RE: [PHP-DEV] Patch for opcode caches From: dmitry@zend.com ("Dmitry Stogov") > -----Original Message----- > From: Marcus Boerger [mailto:mail@marcus-boerger.de]=20 > Sent: Friday, March 14, 2008 9:28 PM > To: Stas Malyshev > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] Patch for opcode caches >=20 >=20 > Hello Stanislav, >=20 > Friday, March 14, 2008, 6:48:52 PM, you wrote: >=20 > > Hi! >=20 > >> Lemme just think, doing inheritance at compile time before we send=20 > >> the stuff to an opcode cache can be slower then? How is that=20 > >> possible? After all late binding means we do it at run=20 > time. And no=20 > >> matter how much faster we can do it. It will always be slower than=20 > >> doing the same thing only once. >=20 > > I'm taking this off-list because it doesn't seem to go any=20 > direction=20 > > it > > can be useful for people to read. >=20 > Hmm, so other people must not read what we discuss, that does=20 > not work. >=20 > > Repeating again: it can not be done "only once". Not with opcode=20 > > caches > > present and bound entities living in separate file. This=20 > thing is not=20 > > possible. If you do not believe it - try to implement it and see. >=20 > That is my point. It can be done.=20 Look into the example: parent1.php parent2.php child.php index1.php index2.php Do you still think if early-binding for class Bar is possible at compile-time with opcode caches? And what "Foo" is the parent? > The reason to delay=20 > inheritance is that we can have a conditional statement=20 > around a class definition.=20 There is no "if' statement in example above. Also detection of conditional code is additional pine for caches. > If we detect classes that do not=20 > have conditionals around them, then we can bind them early. It's wrong. =20 > It is as easy as that. So instead of making the language more=20 > dynamic and even removing a chance of having inheritance=20 > dones early where possible we should work on making the=20 > desired case - eraly binding - as easy as possible. The proposed patch allows caches to implement proper behavior of early-biniding in most easy way. (~5 lines of code) Thanks. Dmitry.