Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90906 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97054 invoked from network); 25 Jan 2016 08:36:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jan 2016 08:36:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.111 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.111 blu004-omc2s36.hotmail.com Received: from [65.55.111.111] ([65.55.111.111:56084] helo=BLU004-OMC2S36.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/E0-26079-79ED5A65 for ; Mon, 25 Jan 2016 03:36:39 -0500 Received: from BLU436-SMTP154 ([65.55.111.72]) by BLU004-OMC2S36.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Mon, 25 Jan 2016 00:36:36 -0800 X-TMN: [NpeZ1QCjis4daXuvr1Pq9IBKAD4K480Y] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) In-Reply-To: <56A5D921.7090800@zend.com> Date: Mon, 25 Jan 2016 09:36:32 +0100 CC: Nikita Popov , PHP internals list Content-Transfer-Encoding: quoted-printable References: <56A5D921.7090800@zend.com> To: Dmitry Stogov X-Mailer: Apple Mail (2.3096.5) X-OriginalArrivalTime: 25 Jan 2016 08:36:34.0354 (UTC) FILETIME=[7F7D5920:01D1574B] Subject: Re: [PHP-DEV] Re: Reusing main VM stack for generators From: bobwei9@hotmail.com (Bob Weinand) > Am 25.01.2016 um 09:13 schrieb Dmitry Stogov : >> We basically need a way to properly first fetch the args (beware: = func_arg fetches...) before instantiating the call frame, an issue which = for example could be solved if we applied my vm_stack_restructuring = patch (because it only installs call frames after all args were = fetched). >=20 > I thought about that approach, but the amount of changes doesn't worth = the result. Doing this only for generators doesn't make a lot of sense. After all, we still have that 2% performance improvement. And the main = VM stack reusage for Generators. And I believe the proposed layout is also much more close to the C = calling convention and thus more compatible if we ever go the route down = to compiling to assembly. Ultimately it gives us more flexibility as we also could put point the = return temporary/cv of some opcodes to the right place, ready to call. We aren't that far yet with the Optimizer, but I think I see it coming, = where we'll benefit more from fixed places. It might be just a few moves = less, but function arg passing is very common in PHP, so the benefit = will be more significant the more optimizations we apply. Remember that small thing removing ZEND_SEND_VAL_SPEC_TMP_TMP_HANDLERs = where unnecessary? When we'll be able to know which variables may hold = references or which not, we'll suddenly be able to directly write to the = function parameter slot in much more cases. I still stand by the point that doing it now (which small, but = non-negligible improvement), will bring us a bigger improvement later. = Many small improvements built around this patch will give us a big one = in the end. Thanks, Bob=