Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126370 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id B10461A00BC for ; Tue, 11 Feb 2025 03:59:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739246180; bh=b1pjJ6WctNGq7WT25rZBPKZLmNZfUnmCq5koCsiMvBc=; h=Date:From:To:In-Reply-To:References:Subject:From; b=LdvBMYCtCbCQgLMjXmFXN4jhuJ4JqVSzAViD6DJGHi8D0xI4uo4rCQ4WBRQltHbsR SzN635jh8zETs4M0TUCiE4+kadu0CSCYVWjP5bGqj4bNdtX0LJplTaOLtXlGq8+j7g sObGQ3E9oD9lr3iwDd5PGBX0O9T470C6Z15U/d7K9Gmupb4fPI0SiY3mb4yr02PHPv sAgZxlU+q53Kjl9FWeFSIBDafyznTnB3KMUGPoG5z9tKCDoxW29M/mIwIMBpq8SExe RpeH7plWA0vSQyhiSCDgujvSMbbUrJW8ONpJdduwPkv4byiIRdvSdUd3Xi/9Dkb/uK CLm3zcyOzxP+A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DEC03180051 for ; Tue, 11 Feb 2025 03:56:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b1-smtp.messagingengine.com (fhigh-b1-smtp.messagingengine.com [202.12.124.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 11 Feb 2025 03:56:19 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id AB0A125401CA for ; Mon, 10 Feb 2025 22:59:02 -0500 (EST) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-01.internal (MEProxy); Mon, 10 Feb 2025 22:59:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1739246342; x=1739332742; bh=PIaqSIorR8rMcPt1fINfs n5jZT1u5zv1BBffDGz7e7w=; b=BUIF22ytL/HdiKmOhJGJo2guS+zwHfzAfUNEo HEYZwBmJ0dBQJoHvZtiH3dXRDJJ/trsDodVSg2LRBAAvyDbmv2QlFwgkz+A111rn IYHMT3V+3KJVJc+Qoyb8XBi/4Q/C0EDGFrZZHSru9TKuZvgsCG8bwLbwqqZ9Cy7w BX8ODUTQrcoVrb1YMgQgS6myqiww48BSJBAvlwVsA7l4oMSbqTuT3nf80szm6ZJB 7Vb2TPZMpQStPybGE7+uZqMmxlLqRLVJO/f+ghabwS4ZKiFI84RqJw75fwxlLw63 hWIfgwSPgNTMYEAdlropIMn4dQQ8xxJT+ytvzeDSE6pt0AkHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1739246342; x=1739332742; bh=P IaqSIorR8rMcPt1fINfsn5jZT1u5zv1BBffDGz7e7w=; b=svR6lvF069hJVUjRu Xge39hdx2Kv3BDp469XIdbbxd0DNMhkKUJoEs9K6XMJpBt35rUGgnO+xLA0F99uD X2M1aoes0kCUBj7GcXLYCmHcfFDm65Ih+30jQRqR+Az38ypN3f97W6uom3Ff1hpp N8k6wk3PafMe/xZLQVLD1DrScJ4xFMuepJVji5zJvJhKWA9jTYafMl6tTSMhVJAg sNftaIDhKUt+21Hkyu6J2EDTApLoYTtsujyXj4toytKfL8dbl4LpDMFFRlN8UyVt 62vBssK+mHsSrAc2AUF6436R9e4OXfMdcULCH7Ecgv2uzKGYTtK0GjOtdST/DQfu E7TUA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefleeliecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvkfgjfhfutgfgsehtjeertdertddt necuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfh hivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhepudegvdelgfeugeehfeej teffudevleethfefgeejffffleegtddtveekgeekudfgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgv tghhrdgtohhmpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtph htthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id B7F9529C006F; Mon, 10 Feb 2025 22:59:01 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Mon, 10 Feb 2025 21:58:41 -0600 To: "php internals" Message-ID: In-Reply-To: <8c53b0fe-cafe-406c-8bab-1cedf2271c2f@gmail.com> References: <0addc1b4-1e4d-45a9-a289-5f9a8e1da692@app.fastmail.com> <8c53b0fe-cafe-406c-8bab-1cedf2271c2f@gmail.com> Subject: Re: [PHP-DEV] [RFC] Static property asymmetric visibility Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Tue, Jan 7, 2025, at 1:21 PM, Niels Dossche wrote: > On 07/01/2025 19:49, Ilija Tovilo wrote: >> I wouldn't necessarily call this a workaround, but more of a missed >> optimization (one branch for each static property write that is >> unlikely to mispredict). If you wish, I can have a look at separating >> cache slots. This may lead to a slowdown due to cache priming (as only >> R/IS and RW/W/UNSET will be shared). To be honest, I doubt either of >> those will lead to a measurable difference in real code. I can confirm >> this by running some benchmarks. The benefit of separate cache slots >> is that it can be entirely handled in >> zend_fetch_static_property_address(), which would reduce VM/ future >> JIT changes, although the separation of the cache slots themselves >> might be more complex (given how it's currently implemented). >> > > I think splitting cache slots will indeed be worse than what it is now. > However, that argument in itself just doesn't really convince me > honestly. > You are likely right about the branch prediction, but the CPU still has > to do some extra work; and it's also just more things to think about as > a maintainer. > I'll think about it more, maybe I'll just abstain from voting. > > Kind regards > Niels Late follow-up here. Ilija finally managed to squeeze in time to benchmark this. Synthetic benchmarks were inconclusive. A practical benchmark using Symfony Demo showed the code from this patch as 0.03% faster than HEAD, which is within the margin of error of the benchmark, so it's basically a wash/no-impact. With that settled, I will be opening the vote on this RFC tomorrow sometime, baring any last second questions or complications. --Larry Garfield