Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93241 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67711 invoked from network); 11 May 2016 14:54:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2016 14:54:27 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 207.46.100.116 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 207.46.100.116 mail-by2on0116.outbound.protection.outlook.com Received: from [207.46.100.116] ([207.46.100.116:48742] helo=na01-by2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/2E-28272-0A743375 for ; Wed, 11 May 2016 10:54:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GkuR7dbYDuyPkl3ibN756Jt0l8X4h93hUOPgXQO77vw=; b=XcZyK02G7bRDhUPUB2tLFb8UpoR7PgCzSCt1MFC4KxGtSSBz3gxAxU9mioa7GD9xknTRvamN73Q6qKl3xHswAjRMCzrxmH1lMrCX2DGhCQFf6Z+A4gB2ZU4Yabnn7jQOj3r8DZa5QyHA2ry+1h8kdmJdiV/J7Dd88XLdwDs3x9k= Received: from BY2PR0201MB1784.namprd02.prod.outlook.com (10.163.72.26) by BLUPR02MB1698.namprd02.prod.outlook.com (10.162.213.28) with Microsoft SMTP Server (TLS) id 15.1.492.11; Wed, 11 May 2016 14:54:20 +0000 Received: from BY2PR0201MB1784.namprd02.prod.outlook.com ([10.163.72.26]) by BY2PR0201MB1784.namprd02.prod.outlook.com ([10.163.72.26]) with mapi id 15.01.0492.016; Wed, 11 May 2016 14:54:19 +0000 To: Bob Weinand , Nikita Popov , Xinchen Hui CC: internals Thread-Topic: Single Stack for all generators Thread-Index: AQHRq49JmAywY+7wRU+E0cjgKEH9RA== Date: Wed, 11 May 2016 14:54:19 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lists.php.net; dkim=none (message not signed) header.d=none;lists.php.net; dmarc=none action=none header.from=zend.com; x-originating-ip: [132.245.81.165] x-ms-office365-filtering-correlation-id: 48085932-e862-4882-6883-08d379ac21ae x-microsoft-exchange-diagnostics: 1;BLUPR02MB1698;5:zglGEDWnaL0FNj4FvWi8X58xe9kOp6o49bHjSwhwEvGEfchDxCtvZoNagUEPBDxFf7xwNXKIkPPKGMbdJz8tONFmVT/cDfkGecAsN9/G/zJGCnM6+OzjwKWOaR3G+JHP7sjWzAIHrqFPCO4H3Ylx+w==;24:87zo7z1xZFwtHr2FYkIEmxRv7aP1kRNW72H0S0V/7jq5+VqRivwVCMeK1er80fkP5kuCKka++lx1VOhWY0b7XfQesLr1xaBHJe4FDZJUe+0=;7:j+0+X4dAMvpikFvQFnCTxZzDNrv4gtFEWLbpmvLkdTWikibEqNE1iVo7iC4sPQp1nxpWW8Y3OIepltkYfxbqfRktDh9YyV18nYb6Zt72a3/MT7gv1qxRtALaJZrJ6cOP3YlJxhNzE4JRYE0a1B/3ErLttfk+Eetate1+kr9dhp8KHT/FQLUvHTxbHz61+HUL x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB1698; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:BLUPR02MB1698;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB1698; x-forefront-prvs: 0939529DE2 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(229853001)(87936001)(6116002)(102836003)(19617315012)(74316001)(4001450100002)(15975445007)(1220700001)(8936002)(19627405001)(5002640100001)(3846002)(2906002)(76576001)(4326007)(86362001)(10400500002)(77096005)(99286002)(586003)(92566002)(106116001)(5001770100001)(5008740100001)(9686002)(122556002)(189998001)(3280700002)(54356999)(2900100001)(3660700001)(33656002)(81166006)(16236675004)(50986999)(19580395003)(66066001)(5004730100002)(5003600100002)(19625215002);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR02MB1698;H:BY2PR0201MB1784.namprd02.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_BY2PR0201MB1784C6F28ADAB5069BD15855BF720BY2PR0201MB1784_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 May 2016 14:54:19.5160 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR02MB1698 Subject: Single Stack for all generators From: dmitry@zend.com (Dmitry Stogov) --_000_BY2PR0201MB1784C6F28ADAB5069BD15855BF720BY2PR0201MB1784_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Nikita, please review the patch https://gist.github.com/dstogov/06116f1610f= 45f8152ine3a9927c6c243ac 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 r= eported: 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. Thanks. Dmitry. --_000_BY2PR0201MB1784C6F28ADAB5069BD15855BF720BY2PR0201MB1784_--