Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126205 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 EB1811A00BD for ; Tue, 7 Jan 2025 19:20:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1736277442; bh=Vj8pkmyWLxPX3GutnDH003JjA5CB4veLVw09Rxbgnlg=; h=Date:Subject:To:References:From:In-Reply-To:From; b=g+CCc4xD9v5ScRPsAB3Tbf5wEwHjhjTHVbV6HFGkaNux/nB82w+Xur2bQMAZsuPlN 1zrhX+mc0tE0eriD72SpHVjEon3L7n4ZTZcvSMaOjn1vVC6/P3I8mLTiQKZZV/2E+T AUz50ChQNkZVpPE0lQE3G8sMSoEXZb9mXx1n829YyY+C7+4VW7EpD0r3IFr9MwAVwo /IITc48n67ECVswIzQ8Qt4vEH+ZHkBk8dU6WyURQzOkgPhl6HRqQF84bjEt2dpALCs 9DeK6pOiMTgABvjH8sijF5yXuHKAN4aTWPDGyM5qTiw0YF+Rfp4tJDbZmfBrtp0iWS mwaVNNryrYv+A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 01B3F180039 for ; Tue, 7 Jan 2025 19:17:22 +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-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 19:17:21 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-385d7b4da2bso13533250f8f.1 for ; Tue, 07 Jan 2025 11:20:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736277616; x=1736882416; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=P/dWl3nfUAzUu+HhvZvuTzrlrFBvtLj0Vc39y1LhKPA=; b=V1MrnV7JjZxh9w7JD4ei9WjJjvl65QnbSVA01MBEZQFIfGfDYLAgKxcmAefidRzweD Mf09sDoRCW9SmK6gM+2QC4GyN/2WwOho82N+QgP1lTmTbOV4QcK10IDoG5/zPW/W9Bvz O6NeOBJKCvbLKw3UsI/ZVZGnJJLiMM8Bj1t6NFHN3/z0mLwwXhbPZ19KgZT8z+uTHbKf yBbtD67Ffwe5/oaV1FLLUP17yzu0q90ISVLV5wuzBhONIiM8hh6AkWhbvdMMVZ0UsBdF mCGHYGrr+ttwGlQ5sw4svD8mVB9VB7Twg4r7pRbDicuJMJcRs+ijqUf06sLeI/YqDhMw 3sQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736277616; x=1736882416; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=P/dWl3nfUAzUu+HhvZvuTzrlrFBvtLj0Vc39y1LhKPA=; b=M9AgW1/4C6QSDdL5CvyYE0HBRQMukHRveo5IDQ1UOKI+w0KN79eJ1aEdaSX3BQU62D +ZazAG8ssdDlOal9eDmOiNgiRIhrkUgmovMu3ND4tpXq865JgbnK66P9y9e2f0yT7lKT QcWZ1zs+prNZIaAJX/ZTy8v5e4YuI7T3yHWgCuRMMlkfJ3SpXgCt+ctKF327u1U6SQ8h bsm4YCufU9VIL+ononSO0yEPoPP923Jm7kmmQSGZQc7qkDjYLHgm7+4nRTRxPXwru4WU C+ecksMCG2d3FG9CvPaXHDxyi/hSsKIY1Lmay04Pob4gVAbyeziCj2Qkw6k/yF1ZwPOR A+QA== X-Gm-Message-State: AOJu0YxHP8N1a30nmjCKaMPk7M49ktlqWsSkjoEJXCF2bn8NXsNoP8Pp QuNmdgmz3H85LCRfaH1FejT3gOxCkts0ilTj/cFe0UJsKXPiWCVwRlb/6w== X-Gm-Gg: ASbGnctozMBxHRPwi4sVBkX7F1X4jqmT89vRNWhMOYQzIcSPUXh8PUEDRkHFGygAkAu YA46MQ1IAMlJjjTeMy2mnmdKyr+WzZm6Dh8mtyNtO31WTgccg7wQwCeHCf8uZcKwo+Qc/10U1nE J3Q+cP2KZG+AYTrUAP1fRDMl9DzItKfqhxAFn8PB8TmYjZKjDQAJx/PhbkwdYy1Zp6LzD/bcSzR mIwHI7vR0A8b8LxS3iINdIiMFQF1kM1tuqbycbuAHGNzBkaERbg8Ym/9uHcaYfC4MmtxvsjbMwf rQw9rUFce2QfdSPiRetXeglVQz9p/tH8aXI00VFq35jWgQpN11xoKdtAxXCCMv9HG3DyMBoz/Of rR8coYUvDWm/2bGzCqqU3 X-Google-Smtp-Source: AGHT+IGIhdkrexxQSoig53oVH96nNjP0QBh1kfVeuf7cv1eJII3fzvdfITENxZ6ErlJ/tToDikFslw== X-Received: by 2002:a05:6000:1886:b0:38a:1ba4:d066 with SMTP id ffacd0b85a97d-38a221f3228mr54415810f8f.27.1736277616161; Tue, 07 Jan 2025 11:20:16 -0800 (PST) Received: from ?IPV6:2a02:1811:cd2f:3500:e093:fcad:4f6:e542? (ptr-du5vm7f5ekzptmf0fgi.18120a2.ip6.access.telenet.be. [2a02:1811:cd2f:3500:e093:fcad:4f6:e542]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43656b3b271sm638221905e9.34.2025.01.07.11.20.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 11:20:15 -0800 (PST) Message-ID: <8c53b0fe-cafe-406c-8bab-1cedf2271c2f@gmail.com> Date: Tue, 7 Jan 2025 20:21:33 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] Static property asymmetric visibility To: internals@lists.php.net References: <0addc1b4-1e4d-45a9-a289-5f9a8e1da692@app.fastmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit From: dossche.niels@gmail.com (Niels Dossche) 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