Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64136 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91514 invoked from network); 3 Dec 2012 13:18:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Dec 2012 13:18:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=yoram.b@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yoram.b@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.199.177.89 as permitted sender) X-PHP-List-Original-Sender: yoram.b@zend.com X-Host-Fingerprint: 212.199.177.89 il-mr1.zend.com Received: from [212.199.177.89] ([212.199.177.89:43045] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 10/52-03565-CA6ACB05 for ; Mon, 03 Dec 2012 08:18:37 -0500 Received: from il-gw1.zend.com (unknown [10.1.1.22]) by il-mr1.zend.com (Postfix) with ESMTP id F21C460776; Mon, 3 Dec 2012 15:11:41 +0200 (IST) Received: from mandor.localnet (10.1.2.24) by il-ex2.zend.net (10.1.1.22) with Microsoft SMTP Server (TLS) id 14.1.255.0; Mon, 3 Dec 2012 15:17:36 +0200 To: Dmitry Stogov Date: Mon, 3 Dec 2012 15:18:32 +0200 User-Agent: KMail/1.13.7 (Linux/3.2.0-2-686-pae; KDE/4.8.4; i686; ; ) CC: Rasmus Lerdorf , Derick , , PHP Internals References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Message-ID: <201212031518.32545.yoram.b@zend.com> X-Originating-IP: [10.1.2.24] Subject: Re: [PHP-DEV] execute_data->Ts removing From: yoram.b@zend.com (yoram bar haim) Hi Dmitry. is this improvemnt (intruction reduce and memory read reduce) preserved under "strong" compiler optimization (-O2, -O3) ? is it something that the compiler can not automatically optimize ? anyhow, the patch seems impressive... On Monday, December 03, 2012 11:35:52 AM Dmitry Stogov wrote: > The new proposed patch: http://pastebin.com/pj5fQTfN > > Now both execute_data->Ts and execute_data->CVs are removed and > corresponding temporary and compiled variables accessed using > "execute_data" as the base pointer. Temporary variables allocate directly > before the "execute_data" in reverse order and compiled variables right > after. So they can be accessed without any additional computations. The > patch reduces the number of executed instructions and number of memory > reads (about 8% less). > > I'm going to commit the patch on Tuesday. > > Thanks. Dmitry. > > On Mon, Dec 3, 2012 at 9:47 AM, Dmitry Stogov wrote: > > Hi Rasmus, > > > > I'm glad the patch is not a big problem for APC. > > BTW: I decided not to commit the patch as is, and implement the similar > > optimization for CVs first. > > Otherwise I may need to change the way TMP_VAR accessed twice. > > I'll probably send the patch for review later today. > > > > Thanks. Dmitry. > > > > On Fri, Nov 30, 2012 at 11:48 PM, Rasmus Lerdorf wrote: > >> On 11/30/2012 09:15 AM, Dmitry Stogov wrote: > >> > Hi, > >> > > >> > The NEWS and UPGRADING explains the details. > >> > > >> > http://pastebin.com/VC71Y8LV > >> > > >> > The patch is big, but actually quite simple. > >> > I'm going to commit it on Monday or Tuesday (if no objections). > >> > > >> > I'm going to look into the similar optimization for CVs, but it's > >> > going > >> > >> to > >> > >> > be a bit more difficult. > >> > >> Looks good to me. I'll commit this change to APC when you commit it: > >> > >> Index: apc_zend.c > >> =================================================================== > >> --- apc_zend.c (revision 328577) > >> +++ apc_zend.c (working copy) > >> @@ -48,7 +48,11 @@ > >> > >> static opcode_handler_t *apc_original_opcode_handlers; > >> static opcode_handler_t apc_opcode_handlers[APC_OPCODE_HANDLER_COUNT]; > >> > >> +#if PHP_MAJOR_VERSION >= 6 || PHP_MAJOR_VERSION == 5 && > >> PHP_MINOR_VERSION >= 5 > >> +#define APC_EX_T(offset) (*EX_TMP_VAR(execute_data, > >> offset)) > >> +#else > >> > >> #define APC_EX_T(offset) (*(temp_variable > >> > >> *)((char*)execute_data->Ts + offset)) > >> +#endif > >> > >> And there are a couple of extensions that are going to need similar > >> changes because of this. pecl/optimizer, pecl/inclued, pecl/xhprof, > >> pecl/operator and xdebug from a quick check. > >> > >> -Rasmus