RE: [PHP-DEV] add_*_vars() speed-up
| From: | Dmitry Stogov | Date: | Fri, 17 Mar 2006 07:25:39 +0000 |
| Subject: | RE: [PHP-DEV] add_*_vars() speed-up | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-22495@lists.php.net to get a copy of this message | ||
Hi Andrei,
I don't see AUTH_USER, HTTPS..., CLIENT_CERT, HTTP_HOST, REQUEST_LINE,
SERVER_URL.
May be not all of them necessary and available in apache, but AUTH_USER,
HTTPS are required for PHP.
Thanks. Dmitry.
> -----Original Message-----
> From: Andrei Zmievski [mailto:andrei@gravitonic.com]
> Sent: Friday, March 17, 2006 1:47 AM
> To: php internals
> Subject: [PHP-DEV] add_*_vars() speed-up
>
>
> Based on Rasmus's profiling efforts, we have determined that
> add_cgi_vars() and add_common_vars() are taking a lot of time. Having
> taken a look at their implementation it seems that they are
> doing some
> unnecessary stuff, like creating a temporary table, filling it with
> entries and then calling ap_overlap_tables() which is supposed to
> overlap it over r->subprocess_env. But r->subprocess_env
> contains only
> a couple of entries by the time add_common_vars() is called, so it
> would be faster to add entries to it directly. Also,
> add_cgi_vars() was
> doing a subrequest in case r->path_info was present, which is
> completely unneeded for PHP as Apache module.
>
> The solution is to duplicate the functionality of these functions in
> mod_php5.c which is what the attached patch does. It also sets
> PATH_TRANSLATED in r->subprocess_env directly, so
> sapi_apache_register_server_variables() does not need to special case
> it.
>
> Please look it over and test. It seems to give about 7% boost on
> average.
>
> -Andrei
>
>