Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79570 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48593 invoked from network); 11 Dec 2014 11:41:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2014 11:41:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=anatol.php@belski.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=anatol.php@belski.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain belski.net from 85.214.73.107 cause and error) X-PHP-List-Original-Sender: anatol.php@belski.net X-Host-Fingerprint: 85.214.73.107 klapt.com Received: from [85.214.73.107] ([85.214.73.107:44820] helo=h1123647.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9A/C0-42256-FF289845 for ; Thu, 11 Dec 2014 06:41:52 -0500 Received: by h1123647.serverkompetenz.net (Postfix, from userid 33) id 50AF023D6007; Thu, 11 Dec 2014 12:41:48 +0100 (CET) Received: from 217.254.139.131 (SquirrelMail authenticated user anatol@belski.net) by webmail.klapt.com with HTTP; Thu, 11 Dec 2014 12:41:48 +0100 Message-ID: In-Reply-To: References: Date: Thu, 11 Dec 2014 12:41:48 +0100 To: "Dmitry Stogov" Cc: "PHP Internals" , "Xinchen Hui" , "Zeev Suraski" , "Nikita Popov" , "Derick" , "Joe Watkins" , "Bob Weinand" User-Agent: SquirrelMail/1.5.2 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] 64-bit performance improvement by reducing zend_op size. From: anatol.php@belski.net ("Anatol Belski") Hi, On Wed, December 10, 2014 16:27, Dmitry Stogov wrote: > Hi, > > > Please, review the following patch > https://gist.github.com/dstogov/fba2cc621ef121826efe > > > It's huge, but actually, only changes in zend_compile.h are matter. The > rest is obvious renaming. > > the main idea - the smaller the zend_op structure, the lees memory > traffic is required to load VM instructions during execution. The patch > reduces the size of each opcode from 48 to 32 bytes (saves 16 bytes for > each opcode, and applications use thousands of opoceds). This reduced the > number of CPU cache misses by 12% and improved performance of real-life > apps by 1-2%. > > The patch affects how constants and jump targets are represented in VM > during execution. Previously they were implemented as absolute 64-bit > pointers. Now they are relative 32-bit offsets. > > In run-time constant now should be accessed as: > RT_CONSTANT(op_array, opine->op1) instead of opline->op1.zv > EX_CONSTANT(opline->op1) instead of opline->op1.zv > > > Jump targets: > OP_JMP_ADDR(opline, opline->op2) instead of opline->op2.jmp_addr > > > The patch doesn't change zend_op representation for 32-bit systems. They > still use absolute addresses. The compile-time representation is also kept > the same. > > The patch must affect xdebug and may be other very engine depended > extensions, but it must not be a big problem to fix them (only > ext/opcache, ext/reflection and sapi/phpdbg required minor changes). > > If nobody objects, I'm going to commit this. > > > Thanks. Dmitry. > > For those willing to test on Windows, a build is available here http://windows.php.net/downloads/snaps/ostc/zend_op_12/ . Perf tests with real apps are still outstanding, but from what i've tested so far there are no regressions. Regards anatol