Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79553 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11466 invoked from network); 11 Dec 2014 06:43:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2014 06:43:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.182 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.217.182 mail-lb0-f182.google.com Received: from [209.85.217.182] ([209.85.217.182:48960] helo=mail-lb0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/80-05320-9FC39845 for ; Thu, 11 Dec 2014 01:43:06 -0500 Received: by mail-lb0-f182.google.com with SMTP id f15so3919964lbj.27 for ; Wed, 10 Dec 2014 22:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=qY5/+HEcYoMBtu2Lxbe8uTwXHZcWI/YOp9VawfgWtXU=; b=f5lL4wgyIYz+PkX0XXJz/WLsOwND0Rib5JDS0lj2gSuajEz5H8v+CGuC3bl3JKB3oa A93sFIiCwdirZqeqp4c3vXdTYIv9xEo9Pi5qP+Opgn8EeSxQqwMZc6uUY11qJrcCUpgg u4cCaZfnIym9qHDU5tAYDFYYEbWA/uq7oO8Y60YTy2n+drXL5ovRevn6VNPECR15E+Uj oBCS+3EJYtRpA2mGJbr6GOkpLhch+8nDzLvJR/y0EH+IZDPD8GS6hF3I8Uicj13JJhOw go7U/1nQzMqHdGjyVUvdGV0oJo+qgABKj0vKW8cLh2FEzhQ3i0kMZqPH347rOAca64dU OkMA== X-Received: by 10.152.204.9 with SMTP id ku9mr7954502lac.55.1418280183018; Wed, 10 Dec 2014 22:43:03 -0800 (PST) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.114.64.176 with HTTP; Wed, 10 Dec 2014 22:42:42 -0800 (PST) In-Reply-To: References: Date: Thu, 11 Dec 2014 14:42:42 +0800 X-Google-Sender-Auth: tvLsYrCXr6JHMxeiex54wMdWzLw Message-ID: To: Dmitry Stogov Cc: PHP Internals , Zeev Suraski , Nikita Popov , Derick , Joe Watkins , Bob Weinand Content-Type: text/plain; charset=UTF-8 Subject: Re: 64-bit performance improvement by reducing zend_op size. From: xinchen.h@zend.com (Xinchen Hui) Hey: On Wed, Dec 10, 2014 at 11:27 PM, 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. As I already participated in this patch, I have no problems & objections. thanks > > Thanks. Dmitry. > -- Xinchen Hui @Laruence http://www.laruence.com/