Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93444 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71376 invoked from network); 23 May 2016 12:39:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 May 2016 12:39:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 65.55.169.136 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 65.55.169.136 mail-bl2on0136.outbound.protection.outlook.com Received: from [65.55.169.136] ([65.55.169.136:21099] helo=na01-bl2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/47-14293-1E9F2475 for ; Mon, 23 May 2016 08:38:58 -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=TaT3ewOy+7EUpVeknbSHHowjBtDUD6wCOpeiPnkyIhg=; b=Ye1PrzRbGimCW9VJQdIjhrioKVBLXDEZ3itidJC8vtcpAG7aqiUViScDzn6kIyo8nryOSkwcGibQMf8icKBz6UKHdcHWwl0K+gyy0LaCoO0xWgkruMplZe0OKV9yc4nj+oX9sXHFGYZ1rnV+gO+y2gr5oU0295JToeqaOFpwPaE= Received: from BY2PR0201MB1784.namprd02.prod.outlook.com (10.163.72.26) by BY2PR0201MB1781.namprd02.prod.outlook.com (10.163.72.23) with Microsoft SMTP Server (TLS) id 15.1.501.7; Mon, 23 May 2016 12:38:53 +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.0501.012; Mon, 23 May 2016 12:38:53 +0000 To: Joe Watkins , Julien Pauli CC: Stanislav Malyshev , PHP internals , Phil Sturgeon Thread-Topic: [PHP-DEV] [RFC][Vote] Typed Properties Thread-Index: AQHRsl29xlQFrvOFJkSnB4pG0wOhsp/GNLQWgAAMHICAAAy0gIAABg8AgAAgycA= Date: Mon, 23 May 2016 12:38:52 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=zend.com; x-originating-ip: [132.245.81.165] x-ms-office365-filtering-correlation-id: ffbd4d31-e367-4cec-5aba-08d3830732fd x-microsoft-exchange-diagnostics: 1;BY2PR0201MB1781;5:FYJaTNbqkDHDI8YnGKohPikiXShEfz8J/mTjXHUx9aky4at1ph09sRKByYJq/cqnucMbrJJmPsyfbHhq2O/2D5gwkUApcQf4wZ5bi60P/Y0dUbAgrX+eNPqeef94JBfdq4ndsXnlQZsNC1s1eqgu6w==;24:9wx+JPo3vnIqb8ppVL8QvDqSvfceNCClUZUb+DizZLpEtgZvlpXDldmAnKOkrsBCq8sUxrW5ZwsOa+4OyaPirtbxIkxbFRxrFW1V+oG6RCU=;7:S8kV2Z73hrqTj2TBuclofOlMFgttGF8EwKOMGBre7zQQM8WqlshKB6eJbAQNnHwLVZ5Y+6ILxgClINbt6v0minlQe8EFCApt67Z0VlsicjYmS+4ip5rI2CAmL2Cm8cZ4pVi1KHV7wtFb/tuvBuJbQEzXEYaSo08ItWkvc/53sJBbcg0kJeblFU2FpX+cSFYu x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1781; 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:BY2PR0201MB1781;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1781; x-forefront-prvs: 0951AB0A30 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(24454002)(377454003)(19627405001)(92566002)(9686002)(122556002)(19625215002)(106116001)(5002640100001)(11100500001)(54356999)(76176999)(8936002)(2906002)(81166006)(33656002)(586003)(8676002)(50986999)(86362001)(99286002)(74316001)(19617315012)(3280700002)(5004730100002)(93886004)(4326007)(2900100001)(5003600100002)(102836003)(3660700001)(66066001)(6116002)(189998001)(19580405001)(19580395003)(5008740100001)(1220700001)(76576001)(15975445007)(77096005)(87936001)(5001770100001)(10400500002)(3846002)(2950100001)(16236675004);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0201MB1781;H:BY2PR0201MB1784.namprd02.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_BY2PR0201MB17844A664FD49C65A7B696FFBF4E0BY2PR0201MB1784_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2016 12:38:52.8582 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB1781 Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: dmitry@zend.com (Dmitry Stogov) --_000_BY2PR0201MB17844A664FD49C65A7B696FFBF4E0BY2PR0201MB1784_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Joe, Unfortunately your solution with IS_TYPE_VERIFIED is not acceptable, becaus= e you update the source zval. If the assigned value is a literal you change read-only memory and crash (w= ith opcache.ptotect_memory=3D1) a =3D 5; ?> Thanks. Dmitry. ________________________________ From: Joe Watkins Sent: Monday, May 23, 2016 1:16:22 PM To: Julien Pauli Cc: Stanislav Malyshev; Dmitry Stogov; PHP internals; Phil Sturgeon Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties Morning internals, I have improved the performance of the patch a little, here's the resul= ts of a bad run: krakjoe@fiji:/usr/src/php-src$ sapi/cli/php -n prop.php empty_loop 0.064 write_prop1() 0.088 0.025 write_prop2() 0.079 0.016 write_prop3() 0.082 0.018 ------------------------ Total 0.314 There is going to be overhead, not the kind we can't minimize, or justi= fy though. Dmitry has said he'll review, and I'm hoping at least Laruence, Nikita,= and Bob will do the same ... We have many weeks to improve the implementation, I'm not going to merg= e anything that's obviously bad :) Cheers Joe On Mon, May 23, 2016 at 10:54 AM, Julien Pauli > wrote: On Mon, May 23, 2016 at 11:09 AM, Stanislav Malyshev > wrote: > Hi! > >> The performance effect of this implementation is terrible. >> >> Assignment to typed property is 2.3 times slower. >> Assignment to untyped property in a class with typed properties is 1.8 t= imes slower. >> >> See the benchmark >> https://gist.github.com/dstogov/1b678712adeee51665cdd829195bb800 > > This is not good. I wonder why these tests weren't made before the vote > and results wheren't added in the RFC. Should we make it a standard > practice to do so? Having 2x slowdown on each property access sounds > like a bad idea. The question is : * should the vote be an idea-based vote, or integrate the code into the vot= e ? My vote did not integrate the code, but the feature. The idea is that if the RFC passes, then the feature is agreed, and we still have some time to find a better implementation. If we could not find one, then the feature should be abandoned or post-poned until a new patch. If the new patch changes the implementation, then the RFC should be reopened. My thoughts. Julien.Pauli --_000_BY2PR0201MB17844A664FD49C65A7B696FFBF4E0BY2PR0201MB1784_--