Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126153 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 E57E91A00BD for ; Sat, 21 Dec 2024 10:10:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1734775633; bh=ZQc3p1SCgft+Ims9x5yd6YZi2tUeKsnyq5LZn98Y16M=; h=Date:Subject:To:References:From:In-Reply-To:From; b=HzS6xaZcm/SPN/K3X2x9Bwy1c2HcEmamq9z5MFU52hXTE11aeAE0A4M4tLijMjl6z NWVhdlKtD8OVR7SJJCaFQjsn/+zq2uXsex5Veddpi1J0oWJe5elulUknZYRkVH9lSO HSeUXN+KwFW5LpFcsGxErJ4MnWsPdSIMzCF4329aL2s1AGSlE62r4c1WL8NmRWSkTh m1rLVFqRBE0z402FKacHd3n4oyuqmKquvHol4UeI7DJUPokGLCXWXDV6nMWT5vyVQI Dr1oQTiNSt35xSFAnu73aJLB13GfgJp+poxJ98koezEl5avPr8F0hzMWytTksFMXTK /UXhuljXRAoqQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 19E6518003E for ; Sat, 21 Dec 2024 10:07:12 +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.2 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) 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 10:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1734775811; x=1735380611; i=cmbecker69@gmx.de; bh=Ez2DIODNP79bXybZVzKBeZNk3B6oJTqLbR7VR0Fq0Dk=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=An++5miJEz9O+W0hxBIeYuVSHNb+57vSeNfTCXZzgphTeCGeyC0Cj2O82stwabZQ 3zK3TbE7MXuwYM8f4wX9dl3h5D9HjdJaz6b6TqUT3EHBxIf+iwdxEFweYuZD6xYlE l1Xns3doUdZ7GptMFJVgyA0spXVtkn0aGYD1zh9K4y3Eo71c8kwh6HsEYEiHzUw0H sUgq1XGiXMHltuLJnuRg3n4Xem9OQUoAvReHD9cxqTFOUBMzu5izgPVtIJsd527Yb TVvFEs8Wv5rVHRNOEbZwrtx0GPyUK/m5wNcABGvDRZHHLI7FyKZ7FImYRgLIqp1hn 20o+mtHFlNlHugkgWw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.2.130] ([79.220.91.186]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N49h5-1tXz2g3Fa5-00w7qU; Sat, 21 Dec 2024 11:10:11 +0100 Message-ID: <7835abaa-06aa-4159-95d7-3313474e50cd@gmx.de> Date: Sat, 21 Dec 2024 11:10:12 +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] Discussion: Remove file statcache? Content-Language: de-DE To: Larry Garfield , php internals References: <27531d9d-9bfe-4acc-b9ab-80b1017e3038@app.fastmail.com> <32bb41ba-11c0-4b20-92d9-7dce513c97a5@gmx.de> <81afe16b-920d-4539-b82a-c33351e56e58@app.fastmail.com> In-Reply-To: <81afe16b-920d-4539-b82a-c33351e56e58@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:znUrUNV8HTVUlCV697xz/tFL/6oiUuaGGgnH4hHWSD1jSsDECVD GvlXHXPW9wGpOKRhszXrkwA4dQ2D2mgc2cnVWFgMESUBLZAOKL5JVsVeaEhMo0CJwCU5uiI cufXU4KsYR9AnwTCno0dCEAdFx5QC+85gxK4ejPBIlXuIgdSi2CmeU2TrPP1IGgphrKWeyf yCbwZm2GlXRUZcUvFH1gw== UI-OutboundReport: notjunk:1;M01:P0:FJKLfPNMg7k=;tbRCOHVzwU0XnXFgdMkwpF6QmCW aYHBh4UnHZpCpqpaOrxiKk/9yZyATSJsbFatxApyzP7EUBUVn1S3CHgBSjRMGv533sktHjNJ0 NgB9UBsqG2BwhMnzFiSeGzi8b7aa0X/fhQIB98MczJj671wegFid0AGLtkI9k6RR4v1FKo9ZB 4Y4pRVssK/+oRVrt3ygI+nNcPIHyLxxu0CKYpUkaA70RgSdfsA9ERsH1dfHJbhR/qbntEpcP4 nXXzCNwF0fZzg2E20Xb4X74RBFAg/44IGjh0dMpNjYSIZke3K3v6r2IoOMdGrWGtAspzkxSHx TaAeCeJdiGlaM1ftzbN0rx1K9jzdejoVZTDJJdwH9iWCG26Bp6tm6NzfOLLJKA+6vEAIaQbPS 2kPe+NtwlFtpVDYnrAwoYmdgtwuZGOz0qQ9Z5i/4tbBFpoLjnS+X4RpqvvQCjcg2f4jooTmid QBvGloh3nNGWHANPh4Cbu0xWxflreBky3fkPoScpZUT6YRJwhDDpN2M6no7vIKPt8POUztsLv 9Gcsp7FiyYmOLA2uFtR3hXvM6NFkCFkgx0fXMzpSfTS2leUHw4xtBimlood676PCI/T7W4cLu ZrA2DRGJC0gu0p5IfYKr9+bNGbBj17azavmbyKBeGr+HLRppsmoY81UnQfpDKUYfhr4DoFmlj yzvTMFu5ZYKKBboDCyO0isoEwZg5AGS4swcrvzgCHSoJAhA46fUUsD61lJDldQ05a5g2+3EQu mH1jlOlyvomoWfICmwrkF3QffkzM1MHmiimK7RAABEMwEvkHaosce2YCBfQSFLjHCg72zer2I 1ggno//1Pgy3kouE9GERxWngFs2hqzSEszE7b4Re2ThY1R+WXabwIC6ArYCKjM0Rri+hBoC9R wo9QXhnTZacUzvJdmKxTycBB+9gkvejeF10LsomKV5n9fWCOU9Wu2EJaakRUuqJylIbygTAu8 TRSl2cbak9JGaAmhnnrf/w6HBJSz+TgjKLYgc8Kj9LqKS5+dlw3dv+3a5yDEzbp1wtJ/wu2Wx 1mnIEepYb9Lk/FpI4ewP/nhTePhn0u5c86b1PwPVRUClVauF7qJkVYFvPZw5SnenOaMoTKPBm sHK+s53CE0XNZy/+jSdoLM3tbPmBDGHHrvKKU/wHeZsPgTRw2fFKuvyuzJo8nXMNmZGZoUCZc = From: cmbecker69@gmx.de ("Christoph M. Becker") On 21.12.2024 at 06:49, Larry Garfield wrote: > On Fri, Dec 20, 2024, at 3:35 PM, Christoph M. Becker wrote: > >> 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] > > 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 depr= ecation 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. T= hat just gives them a deprecation notice they cannot fix, if they're in on= e of the very few situations where manually clearing the cache is useful. = That doesn't seem great. I believe the whole point of the stat cache is to optimize multiple consecutive calls to stat releted functions on the same file *name*. E.g. code like $mtime =3D filemtime($filename); $fsize =3D filesize($filename); would be a relevant example. Such code could be changed in userland to $stat =3D stat($filename); $mtime =3D $stat["mtime"]; $fsize =3D $stat["stat"]; where the stat cache would be irrelevant. Of course, users who are not aware that there may be a difference in performance won't even think about that. As such a deprecation message could be triggered whenever the stat cache is hit, possibly pointing also to the file:line where the cache had been populated. The usefulness of this is based on the assumption that it's pretty unlikely that the stat cache is hit from unrelated code paths. If a general deprecation is not desired (and that seems to be the case), I'm also fine with a PR/patch that users could apply themselves, similar what Nikita did back then when string to number comparisons changed[1]. Note that clearstatcache() should not be no-opped altogether; clearing (parts of) the realpath cache seems still useful. [1] Christoph