Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39399 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52038 invoked from network); 28 Jul 2008 07:48:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jul 2008 07:48:15 -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.163 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:12210] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/C8-31471-CB97D884 for ; Mon, 28 Jul 2008 03:48:15 -0400 Received: from [10.1.10.10] ([10.1.10.10]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 28 Jul 2008 10:48:48 +0300 Message-ID: <488D79AD.9040607@zend.com> Date: Mon, 28 Jul 2008 11:47:57 +0400 User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Nuno Lopes CC: Matt Wilmas , internals@lists.php.net, Andi Gutmans , Stanislav Malyshev References: <00ea01c8a160$2edd8160$0201a8c0@pc1> <016c01c8eccd$e28cfac0$0201a8c0@pc1> <488835D0.1040005@zend.com> <00e501c8ed77$3498cf20$0201a8c0@pc1> <48889901.8000008@zend.com> <022c01c8ee74$5b539340$0201a8c0@pc1> <488C5464.1030706@zend.com> <7ca798440807272104o744ce8e6oee52f0e1f9cc4074@mail.gmail.com> In-Reply-To: <7ca798440807272104o744ce8e6oee52f0e1f9cc4074@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Jul 2008 07:48:49.0335 (UTC) FILETIME=[5F306470:01C8F086] Subject: Re: [PHP-DEV] New optimization idea; was: No runtime fetching of built-in global constants From: dmitry@zend.com (Dmitry Stogov) It's great. So it's nothing to do in the scanner. I can just change the CGI code. Thanks. Dmitry. Nuno Lopes wrote: > I'm not Matt, but I'll try to answer :) > > Actually the new re2c scanner already handles the shebang thing, so I > think you can safely remove the explicit support for it in CGI. We had > to had that because CLI doesn't explicitly support the shebang line. > > Nuno > > P.S.: now it makes sense why we never found the code in the flex > scanner that handled the shebang line :P > > > On Sun, Jul 27, 2008 at 11:56, Dmitry Stogov wrote: >> Hi Matt, >> >> At first as you are a scanner expert, I would like you to look into another >> optimization idea. >> >> Probably for historical reason PHP supports shebang lines >> (#! /usr/bin/php) on top of php files. Especially to handle them PHP >> (CGI/FastCGI/CLI) opens file and check for it. So even with opcode caches >> FastCGI PHP does open syscall for the requested script, however with opcode >> caches it's absolutely useless. >> >> In case PHP scanner will handle shebang lines itself, we will able to save >> this syscall. >> >> I never had time and enough flex/re2c knowledge to implement this idea >> myself. May be you'll able to look into the problem. In case you find a >> simple solution we will able to do it in php-5.3. >> >> Most PHP hosters and large sites use FastCGI with opcode caches (it is also >> the primary way for MS Windows users), so this optimization is really >> important.