Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93246 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79376 invoked from network); 11 May 2016 16:44:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2016 16:44:41 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.175 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.175 mail-yw0-f175.google.com Received: from [209.85.161.175] ([209.85.161.175:33723] helo=mail-yw0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/30-28272-77163375 for ; Wed, 11 May 2016 12:44:40 -0400 Received: by mail-yw0-f175.google.com with SMTP id t10so54160380ywa.0 for ; Wed, 11 May 2016 09:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=mCy17UT+L2DZbAtB0XebhNgydNMQIIgh4MxcgLvz8a4=; b=aiJHxtw+MMtr87HK04blHCZzPqVnhYGlzxOBv41gHZKkSO1UT4dDTUCnmeAb+g5KzU avf6PVUE3/l1SILIY4BZNZtdTWfHdMU0/HOmZUxf/b/LNNNkZWtaNN9KdVFcag55E8Qa htAXpFx7RYbCsmmdyna0cklgMXIDnGF9+1gqOsX8nNb10qHEW44bEA0FNu5Ge9kjI8b/ payM/dcaxsDMCMJloAkJ8ieCPOeKno7BzpaSrbHudDr0OiFWtR1i8w16mjY641HUrg5k tTwafgDBikJNLpvHHfasR1huavi9x4ZbvD7TRYJWD3Om93CP65OF1aP1Q777RNY77s2/ vwbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=mCy17UT+L2DZbAtB0XebhNgydNMQIIgh4MxcgLvz8a4=; b=lERpi6ihfNPLjvZ3wbomsnaQfpymqPQyQbbasqL836B5YiTF2fJ4SoT3pXlnqZIIL9 DG5yMFxZ3cdZydOWRz9pycE+BxKZtGHt1EkJjizL29C4yQihfP5jSHre4gfJG/nuoV9Q eeRj1fgrtEDR0g8r6xZ3Tcj6gzvARDVV6Dx3zgir3B+3Wcra3ImLIXiT3lTb4TR1jOu6 j3tU+Jn/bH5LHN3hTKgi+uxAamwIj/iGujjnZ/9Dg8qwM9qApD062hcuyHlR3DzAxprH J+4c/s7Qh/qjlzIRNJ/WlysrfXOCI/VGpFUWJKu0/60lTNtRtY4xtELBuQv+Z60ffHc+ gROA== X-Gm-Message-State: AOPr4FXmBZrFXl5tpKWQ706lSxi3FXiCSaOC9xWFNakKru4PiGJerhFudl1B4rsCK3nPaw5uT76OtIOnYm3SKQ== MIME-Version: 1.0 X-Received: by 10.129.3.17 with SMTP id 17mr2404667ywd.288.1462985077475; Wed, 11 May 2016 09:44:37 -0700 (PDT) Received: by 10.13.239.3 with HTTP; Wed, 11 May 2016 09:44:37 -0700 (PDT) In-Reply-To: References: Date: Wed, 11 May 2016 18:44:37 +0200 Message-ID: To: Dmitry Stogov Cc: Bob Weinand , Xinchen Hui , internals Content-Type: multipart/alternative; boundary=001a1142d7bedae478053293c109 Subject: Re: Single Stack for all generators From: nikita.ppv@gmail.com (Nikita Popov) --001a1142d7bedae478053293c109 Content-Type: text/plain; charset=UTF-8 On Wed, May 11, 2016 at 4:54 PM, Dmitry Stogov wrote: > Hi, > > > Nikita, please review the patch > https://gist.github.com/dstogov/06116f1610f45f8152ine3a9927c6c243ac > > It's the next attempt to use the single stack for all generators. > > Now I don't see any problems or BC breaks. > > > In case "yield" is used as an expression in context of function call. e.g. > var_dump(yield), engine backups and then restores active call frame chain. > > > Bob tested the patch on application that intensively uses generators, and > reported: > > 15% less L2 cache loads > > 20% less cycle stalls due to memory subsystem > > 3% more CPU_CLOCK_UNHALTED due to additional freeze/restore. > > > I'm going to commit this patch tomorrow. > The patch looks fine to me. From my own testing with a "Hello World" Aerys server, after multiple benchmark runs it previously started to mmap+munmap two new MM segments on each request, leading to a decline from 50k rps to 5k. With the patch this no longer occurs and the rps is stable at > 50k rps. (Though that may be more luck than anything.) Nikita --001a1142d7bedae478053293c109--