Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22495 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72251 invoked by uid 1010); 17 Mar 2006 07:26:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 72236 invoked from network); 17 Mar 2006 07:26:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Mar 2006 07:26:20 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:51584] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 2F/DE-55982-B946A144 for ; Fri, 17 Mar 2006 02:26:20 -0500 Received: (qmail 7926 invoked from network); 17 Mar 2006 07:26:16 -0000 Received: from internal.zend.office (HELO thinkpad) (10.1.1.1) by internal.zend.office with SMTP; 17 Mar 2006 07:26:16 -0000 To: "'Andrei Zmievski'" , "'php internals'" Date: Fri, 17 Mar 2006 10:25:39 +0300 Message-ID: <000001c64994$019187e0$6e02a8c0@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 Importance: Normal In-Reply-To: <94786d199eeff897a7549d77d43f03c0@gravitonic.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 Subject: RE: [PHP-DEV] add_*_vars() speed-up From: dmitry@zend.com ("Dmitry Stogov") References: <94786d199eeff897a7549d77d43f03c0@gravitonic.com> 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 > >