Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39227 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12749 invoked from network); 23 Jul 2008 14:10:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2008 14:10:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=php_lists@realplain.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php_lists@realplain.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain realplain.com from 209.235.152.152 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 209.235.152.152 mail962c35.nsolutionszone.com Linux 2.5 (sometimes 2.4) (4) Received: from [209.235.152.152] ([209.235.152.152:49332] helo=mail962c35.nsolutionszone.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/42-12534-2EB37884 for ; Wed, 23 Jul 2008 10:10:42 -0400 X-POP-User: wilmascam.centurytel.net Received: from pc1 (d13-125.rt-bras.pell.centurytel.net [69.179.187.125]) by mail962c35.nsolutionszone.com (8.13.6.20060614/8.13.1) with SMTP id m6NEAb91031080; Wed, 23 Jul 2008 14:10:38 GMT Message-ID: <016c01c8eccd$e28cfac0$0201a8c0@pc1> To: Cc: "Dmitry Stogov" References: <00ea01c8a160$2edd8160$0201a8c0@pc1> Date: Wed, 23 Jul 2008 09:10:37 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Subject: Re: [PHP-DEV] [PATCH] No runtime fetching of built-in global constants From: php_lists@realplain.com ("Matt Wilmas") Hi all, Never heard anything about this optimization after sending it 3 months ago (should've sent a follow-up sooner)... Is this something that can be done? Dmitry? Details in original message. Patch is unchanged, I just updated them for the current file versions. http://realplain.com/php/const_ct_optimization.diff http://realplain.com/php/const_ct_optimization_5_3.diff Thanks, Matt ----- Original Message ----- From: "Matt Wilmas" Sent: Friday, April 18, 2008 > Hi all, > > I changed things so that the many "built-in" constants (CONST_PERSISTENT > ones) will be replaced at compile-time, saving the FETCH_CONSTANT opcode, if > these changes are usable. This was added for TRUE/FALSE/NULL 2 years ago, > but seems like it can be done for "lots" of others too. > > Since the change 2 years ago, other constants have been getting looked up > also, but just discarded. And if a constant wasn't found, its name was > lowercased and looked up again (for case-insensitive TRUE/FALSE/NULL). > Lowercasing has been removed, since case-insensitive constants can't be done > (guess an exception was made for TRUE/FALSE/NULL :-)), and TRUE/FALSE/NULL > get flagged in the scanner (not reserved words, which Marcus did briefly a > few years ago), skipping a hash lookup. BTW, to get this compile-time > optimization in a namespace, it needs to be prefixed (::CONSTANT). > > I also removed an unnecessary memcmp() in zend_get_constant() -- old code > that was needed a long time ago, it appears. > > http://realplain.com/php/const_ct_optimization.diff > http://realplain.com/php/const_ct_optimization_5_3.diff > > Thoughts? > > > Thanks, > Matt