Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126152 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 B0BCA1A00BD for ; Sat, 21 Dec 2024 05:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1734759994; bh=MLZqYY+3jG4pFeLtiLSCMrbjvwIjI89Zr1PXVP27Dl0=; h=Date:From:To:In-Reply-To:References:Subject:From; b=mmXlhHotSkro/fNUb7Q4/SD1mX3qbKGH98xofBaldqQ4u7OuVGrd0YftRFRP2JAhE 4IvdpvAlWug0gJbwbv6VM0J2BI/4TR+uho4VahSmkSHJzy5zsuvaPswR3qhU8AjpiX 60zfcmcS1onB2vN2/tO4Oy54GcyaR6c8kgKaha+0twE8z5KV8XI/itaMFnf+b/spwy 64+vbPb7aNJoJXCgmPIfHzVJ5Y9VTO/sVDG/gIxik4EhK6Ud5pKdqB5wwfuu8nk4iU m7E9VfFA+6F1x4H7lcxrqMNxRGRbmZqtHoG8A5fAV2P49QiE8LTGgpacKPEh55iNyq OJShkG0Xt4ObQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 52431180072 for ; Sat, 21 Dec 2024 05:46:33 +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.1 required=5.0 tests=BAYES_50,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-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) (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 ; Sat, 21 Dec 2024 05:46:32 +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 6C08C254016F for ; Sat, 21 Dec 2024 00:49:34 -0500 (EST) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-01.internal (MEProxy); Sat, 21 Dec 2024 00:49:34 -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=fm1; t=1734760174; x=1734846574; bh=K8/W4kKFl+yrhHL0ULYVC hUJDpxZe+eNCGJfaJRk6AQ=; b=PVtgkCR4zrkbQLQ1QeFkM/gHLiILHFt3R98X/ u2zOzgD8tUNk9IWV7wR4J0Y7kKbc7NalgBGJ65hab+21gByTOCF/cvrxv99IQZWO fU5bu9hCxO2Q87Q2jdz375KQ/1Pj5UXmxukG55hUJKFUebvp9cs4WSXT49HJP5sZ gaQlp39AX+OgRujY1pJvu9kV4WmI9ALJW/Bv9RLaxSY/v24YB8+68Xf5dVjycprv 6gZ3pF4Sh+q0UF9a3s5wR/41kIKfgXqeA3K8ZriumPPi/4HJXxfz7v4SKFigeF9f ebP+ik06YIAjctEYJnQzrjrp6Kn93uxldunCJvVpf5lBK40/Q== 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=fm1; t=1734760174; x=1734846574; bh=K 8/W4kKFl+yrhHL0ULYVChUJDpxZe+eNCGJfaJRk6AQ=; b=yBqxc7vwHcUiiEUnE BQJBjrveEfM3mtjhdlBjXTW88lwpC8tWGr6P4fXLMOa82wQ32rY4lyKLH/FPAbd/ FsfTGXyGQRFjh3mzPVRmc+5dRJKUs8JSKiJux0DbjVHe77dxW1W6KJqgO2THFJe1 dFO2EUUoHfqRHqJg0gZrBYMZUu6FDHDu4M5DXLXBFRsdVSr9lWr/ViBXF4fDlAUW v6nX6/Cs6C3mL8kHfqnj4ICAnuxaoLXbX3ISiZ6QkuKc1ubGyDqQYq8XeIREphw0 PpF0VvoZOKiLoEMiuoPLX4AOTIBPVYpijar+3aT6LYDdE/vl5/458nIrqXoTqx+x tBrFg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddtfedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepofggfffhvffkjghfufgtgfesthejredtredttden ucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfih gvlhguthgvtghhrdgtohhmqeenucggtffrrghtthgvrhhnpeeuheejudelteelieehleel leekvddtgfettdeghffggeehvdejgeejfeffuefhvdenucffohhmrghinhepghhithhhuh gsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsggprhgtphhtthhope dupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhs thhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id F1C3529C006F; Sat, 21 Dec 2024 00:49:33 -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: Fri, 20 Dec 2024 23:49:13 -0600 To: "php internals" Message-ID: <81afe16b-920d-4539-b82a-c33351e56e58@app.fastmail.com> In-Reply-To: <32bb41ba-11c0-4b20-92d9-7dce513c97a5@gmx.de> References: <27531d9d-9bfe-4acc-b9ab-80b1017e3038@app.fastmail.com> <32bb41ba-11c0-4b20-92d9-7dce513c97a5@gmx.de> Subject: Re: [PHP-DEV] Discussion: Remove file statcache? Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Fri, Dec 20, 2024, at 3:35 PM, Christoph M. Becker wrote: > On 20.12.2024 at 20:26, Larry Garfield wrote: > >> Background: PHP has a not-often-considered feature, the stat-cache. That is, the runtime caches the OS stat() call for files, so that subsequent reads on the same file can be faster. However, it's even less realized that it's a single-file cache. It literally only applies when you try to do two file-infomation operations on the same file in rapid succession, without any other file reads in between. >> >> There's been some discussion about making the cache disable-able, though the consensus now seems to be leaning toward getting rid of it outright: >> >> https://github.com/php/php-src/pull/17178 >> >> Arnaud ran some quick benchmarks and found that disabling it has a less than 1% impact on Symfony and WordPress. >> >> https://github.com/php/php-src/pull/17178#issuecomment-2554323572 >> >> Before we go any further, is there appetite among the voting population to remove it? clearstatcache() and similar functions would get stubbed out as no-ops, but otherwise we'd just hand the responsibility back to the OS where it belongs, which seems so far like it would be almost an unmeasurable performance difference but remove some surprise complexity. >> >> Would you support such a removal? > > I still think the stat cache should be *deprecated* first. That gives > users a chance to reconsider calling multiple stat related functions > instead of doing a single stat() call. See my previous comment[1] for > some further details. > > [1] > > Christoph What exactly would deprecation look like here? My plan was to just rip the cache out, and update clearstatcache() to be a no-op, but issue a deprecation message "Hey, this doesn't do anything anymore." And then we can remove the function itself in like PHP 10 or something, because it doesn't hurt anything to leave it be. I don't see there being much value to a period of "hey, this is *going* to do nothing in the future", when users couldn't do anything about it. That just gives them a deprecation notice they cannot fix, if they're in one of the very few situations where manually clearing the cache is useful. That doesn't seem great. --Larry Garfield