Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79541 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68056 invoked from network); 10 Dec 2014 19:35:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2014 19:35:17 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.182 as permitted sender) X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.213.182 mail-ig0-f182.google.com Received: from [209.85.213.182] ([209.85.213.182:62703] helo=mail-ig0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/B7-29826-370A8845 for ; Wed, 10 Dec 2014 14:35:17 -0500 Received: by mail-ig0-f182.google.com with SMTP id hn15so3521442igb.9 for ; Wed, 10 Dec 2014 11:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=D+n+hDLxcSii+8OJK+h1rR2yP//5F2ZhhRj61QguRPs=; b=xWImlt3dYFsh+VnkTIZXmPb4k5+dMmCJWT8TXUVRcIr5JYhq7iopnaiAWQ/cxxUVJ8 EKN+Yyd4fW3ImRj02fbRJcg/zJhDO0dbGbP+AsySO6aSw7G2//0Qud99rTBo90sb89ul M38dmfti6xqJaE8isi+HwVj8lQb5TDtkVFr6wBPDYseWVYSySFK26g8kwDIEiq/iPC8+ fM6n1Y1YwstD8XWtu33NPhdzp/JcTL8GOEV1OaSoR+MRNJAEyoI7R3tqleoFeovGjEqd wFiM66hYmBkjbP2eMY3ciCBzSsmclMM764zow11efvhIKNXuhPHG9y6Y6PvhICRDbJby O1JQ== X-Received: by 10.50.98.101 with SMTP id eh5mr27913634igb.31.1418240112712; Wed, 10 Dec 2014 11:35:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.238.75 with HTTP; Wed, 10 Dec 2014 11:34:52 -0800 (PST) In-Reply-To: References: Date: Wed, 10 Dec 2014 14:34:52 -0500 Message-ID: To: Dmitry Stogov Cc: PHP Internals , Xinchen Hui , Zeev Suraski , Nikita Popov , Derick , Joe Watkins , Bob Weinand Content-Type: multipart/alternative; boundary=047d7b2e0d851fe2300509e1c2d7 Subject: Re: [PHP-DEV] 64-bit performance improvement by reducing zend_op size. From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --047d7b2e0d851fe2300509e1c2d7 Content-Type: text/plain; charset=UTF-8 Seems good for me. =) On Wed, Dec 10, 2014 at 10:27 AM, 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. > -- Guilherme Blanco MSN: guilhermeblanco@hotmail.com GTalk: guilhermeblanco Toronto - ON/Canada --047d7b2e0d851fe2300509e1c2d7--