Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126204 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 2F2FF1A00BD for ; Tue, 7 Jan 2025 18:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1736275633; bh=p077uiG8ESutMn3USFnuDkjSD4+plvPes6iJREOTwEQ=; h=References:In-Reply-To:From:Date:Subject:To:From; b=ZChBP/HRH8C78b4qujOtPt1/emR0B3Y7QZVjVwtEH2ZAn+WKaO9LeGIxiuNtOp3bC lKkZgZ4vAN6RqKP0XSBRCiEYZxcczwWMYICZj3I3Di5GIXAWebLMRKk+zWi0RBmw/n lfI6WtjhQ34hJPAO8P86p5g2kUXS1n+xRXwymyfydlYDzqaAwjYq3d4voJFTCUmXyK 0OlKyQWMrsFms59StYJik2XC6FPwb8s2nV4pHarXQXJCjyVzcT6Ny7bD/RYzcQNEwF CAa+IK/vrHyIQK80/VhEgL/92ZAokHrBBAFITTlQ0RBKEwoe/SteYAZg6VkmUnIVks us1fx+GnWVBSw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3014018006A for ; Tue, 7 Jan 2025 18:47:13 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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, 7 Jan 2025 18:47:12 +0000 (UTC) Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6d900c27af7so127538986d6.2 for ; Tue, 07 Jan 2025 10:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736275808; x=1736880608; darn=lists.php.net; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=p077uiG8ESutMn3USFnuDkjSD4+plvPes6iJREOTwEQ=; b=nTYEhn3nvttpC+hq2R1wgN21OtxY5O0S9YCeIt2f7Rh68VBz/cKfd4NHUGXpZbhxKm Scekx6ExCo3X8tNFPc/JkV57xbbL43qdV9sHqmD6/o2zNRnLvetGMDvDNEzTJx+iKtij oPWcuMXJRbJT38nRYzA5iWvEeLzJcsW3XdOm1EOMEmgt3FcWgtpvhQWahU8pfXQQrM/e SnctF+XJpKse3Xaf0KqoACF978H5oSsy0VrJ76VWARAfBpNVfHTVUzqo6Q5ulCFft12J BIRoZiInsoCWZ4Ja1P/z8ualWCLef2DZ4/LKIexRCQe9HgPPf5syn23hSk+ptFRKJfx4 NT5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736275808; x=1736880608; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p077uiG8ESutMn3USFnuDkjSD4+plvPes6iJREOTwEQ=; b=upAIn8als/nY+Pjx6DBAnmS61cFjlbPkSN1UcpyxfdpZ+XAVI9K+IRfSAX+HTqo8ze GydF3Ote70aDBoxrXkWCMz6U8SSrrtZsNZCS8f96l8oTCJr3xZDj/tDp6pin2mYuI6Ws t6ZnQL6CNzyUVISykZfUtKIX8TaN8tggqXpUl/aUFlqCUL5KMwK/TvrLR+pNWmDqKWoP 3ZaGCD24EjSoj53z8Xe+3P8c/7Cib4vqAp4uOvGqAd/s8ykT4gsnVfFFQ3OgiBD+zbQc c18/1zJAiZOzsdc1qtMkef2OAK8oEEHiSb/lWTYv089jnO1M49ne2emVe4euWzt3EFrE jDyQ== X-Gm-Message-State: AOJu0YxEbIIP93sp8C5AjOA4+Lnp0DSJJ7IwHzu9F+ASdKDL/rONcNyz EMOFARE/sbcBl+kHk040gkCciQfyzMTNKtxmwaSltFRJLxFzZQpgeCAEhN0GJB/QOiKRoUQJiv2 ICDYTBPIDXB90DCY+z+dtgQk5QQgtYqNtF+0= X-Gm-Gg: ASbGnctuxGqVMjcFQu3jvv0oSNy76PDsu9rKQQqGIJaAj1g7WxaoTZcxgjaFK+bqer3 QT2HJjqmEst4BW8jQeOjQDQpGSYljocx2CZzzF8ANjzplf6FLwO84Xr4ggBoQWEEF+YsIy42N X-Google-Smtp-Source: AGHT+IG71+nS7lZMxGXAFovNw2tkY4r9zbEk5uA4BlzJ+q67FzxJTcmwcaq3aUTN00ZvNTjVxgwzJkJEVcoXCow0P7Y= X-Received: by 2002:a05:6214:3d87:b0:6df:8112:3e48 with SMTP id 6a1803df08f44-6df9b2ce45cmr2324976d6.36.1736275807934; Tue, 07 Jan 2025 10:50:07 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <0addc1b4-1e4d-45a9-a289-5f9a8e1da692@app.fastmail.com> In-Reply-To: Date: Tue, 7 Jan 2025 19:49:57 +0100 X-Gm-Features: AbW1kvbIffkCmPqbWaHkVdFBWpOIk4vTSl91pq56ephAbrAll0F72OBvhN2rc8U Message-ID: Subject: Re: [PHP-DEV] [RFC] Static property asymmetric visibility To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Niels On Tue, Jan 7, 2025 at 7:37=E2=80=AFPM Niels Dossche wrote: > > On 04/01/2025 00:14, Larry Garfield wrote: > >> > >> https://wiki.php.net/rfc/static-aviz > I'm not sure how I feel about this. > The current implementation actually uses a workaround because otherwise i= t interferes with cache slot merging. > This creates duplicated code in the VM handlers. Although the complicatio= n is small, it still is one. And the complication may be duplicated in the = future in the JIT. > Workarounds/complications can be fine if having the feature is justifiabl= e, but you said yourself that it seems of little use and the RFC text says = it's just for completeness. > So honestly, I'm conflicted and leaning towards voting "no". 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). Ilija