Re: New optimization idea; was: No runtime fetching of built-in global constants
| From: | Nuno Lopes | Date: | Mon, 28 Jul 2008 04:04:18 +0000 |
| Subject: | Re: New optimization idea; was: No runtime fetching of built-in global constants | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39392@lists.php.net to get a copy of this message | ||
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 <dmitry@zend.com> 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.